BETA
This is a school problem. Successful submissions of this are not counted in user ratings.

Submissions : 759 Accuracy :

15.02

Find number of days between two given dates
     

Given two dates, find total number of days between them. The count of days must be calculated in O(1) time and O(1) auxiliary space.

Note: The system follows Gregorian calender from the beginning of the time.

Input:

The first line of input contains an integer T denoting the number of test cases.
Each test case consist of two lines each containing three integers D, M and Y, separated with a space, denoting date, month and year respectively.

Output:

Print a single integer denoting total number of days between the given dates.

Constraints:
1 ≤ T ≤ 100
1 ≤ D ≤ 31
1 ≤ M ≤ 12
1 ≤ Y ≤ 3000

Example:

Input
4
10 2 2014
10 3 2015
10 2 2000
10 3 2000
10 2 2000
10 2 2000
1 2 2000
1 2 2004

Output
393
29
0
1461

**For More Examples Use Expected Output**


Set Default Code

					   
Result:
It is recommended to test your code before clicking 'Submit' button!



                   



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.