BlueBook - Days

View as PDF

Submit solution

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

Problem type

Given a year Y (0 \le Y \le 3\,000), month M (1 \le M \le 12), 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 (1 \le T \le 100) denoting the number of test cases.
Lines 2\ldots T+1: Three integers Y, M, D.

Output Specification

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

Sample Input

1990 1 1
1992 3 1

Sample Output



There are no comments at the moment.