F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Zhu¡¯s Math Problem

Time Limit: 3000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 408    Accepted Submission(s): 175


Problem Description
Zhu is a powerful ACMer/OverWatcher, now a salt-fish comes to ask Zhu a difficult problem. Zhu thinks that problem is so easy, so he wants to know whether you can solve it?
The problem content are as follows.
You are given four integers A , B , C , D , there are many different (a,b,c,d) satisfy $a+c>b+d$ && $a+d\ge b+c$ && $0\le a\le A$ && $0\le b\le B$ && $0\le c\le C$ && $0\le d\le D$ ?
 

Input
First Line is an positive integer $T(T\le 1000)$ , represents there are T test cases.
Four each test£º
The first line contain four integers A , B , C , D.
You can assume that $0\le A,B,C,D\le 10^{18}$
 

Output
For each test case, output an positive integer represents answer, because the answer may be large , so you are only need to output answer mod $10^9+7$
 

Sample Input
1 2 1 1 1
 

Sample Output
10
 

Author
UESTC
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-26 22:46:17, Gzip enabled