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


  • 0
    maxcruickshanks  commented on March 30, 2026, 12:58 a.m. edited

    Since the original data were weak, an additional test case was added, and all submissions were rejudged. The issue was noticed by franklincool.