BlueBook - Days

View as PDF

Submit solution

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

Problem types
BlueBook

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 \dots T+1: Three integers Y, M, D.

Output Specification

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

Sample Input

2
1990 1 1
1992 3 1

Sample Output

1
61

Comments

There are no comments at the moment.