BlueBook - Days

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 16M

Problem types
BlueBook

Given a year Y (0Y3000), month M (1M12), and day D (depends on what month it is, but will be correct input), output how many days it has been since the beginning of the year.

Be sure to take care of leap years! The year 0 is a leap year.

Input Specification

Line 1: One integer T (1T100) denoting the number of test cases.
Lines 2T+1: Three integers Y, M, D.

Output Specification

Lines 1T: One integer denoting how many days have passed since the beginning of the year.

Sample Input

Copy
2
1990 1 1
1992 3 1

Sample Output

Copy
1
61

Comments

There are no comments at the moment.