

Time Limit: 2 sec / Memory Limit: 1024 MiB
配点 : 100 点
問題文
1583 以上 2023 以下の整数 Y が与えられます。
西暦 Y 年の日数を求めてください。
なお、制約の範囲内では西暦 Y 年の日数は以下の通りです。
-
Y が 4 の倍数でない年は 365 日
-
Y が 4 の倍数で、かつ 100 の倍数でない年は 366 日
-
Y が 100 の倍数で、かつ 400 の倍数でない年は 365 日
-
Y が 400 の倍数である年は 366 日
制約
- Y は 1583 以上 2023 以下の整数
入力
入力は以下の形式で標準入力から与えられる。
Y
出力
西暦 Y 年の日数を整数として出力せよ。
入力例 1
2023
出力例 1
365
2023 は 4 の倍数でないので 365 日です。
入力例 2
1992
出力例 2
366
1992 は 4 の倍数で、かつ 100 の倍数でないので 366 日です。
入力例 3
1800
出力例 3
365
1800 は 100 の倍数で、かつ 400 の倍数でないので 365 日です。
入力例 4
1600
出力例 4
366
1600 は 400 の倍数なので 366 日です。
Score : 100 points
Problem Statement
You are given an integer Y between 1583 and 2023.
Find the number of days in the year Y of the Gregorian calendar.
Within the given range, the year Y has the following number of days:
-
if Y is not a multiple of 4, then 365 days;
-
if Y is a multiple of 4 but not a multiple of 100, then 366 days;
-
if Y is a multiple of 100 but not a multiple of 400, then 365 days;
-
if Y is a multiple of 400, then 366 days.
Constraints
- Y is an integer between 1583 and 2023, inclusive.
Input
The input is given from Standard Input in the following format:
Y
Output
Print the number of days in the year Y as an integer.
Sample Input 1
2023
Sample Output 1
365
2023 is not a multiple of 4, so it has 365 days.
Sample Input 2
1992
Sample Output 2
366
1992 is a multiple of 4 but not a multiple of 100, so it has 366 days.
Sample Input 3
1800
Sample Output 3
365
1800 is a multiple of 100 but not a multiple of 400, so it has 365 days.
Sample Input 4
1600
Sample Output 4
366
1600 is a multiple of 400, so it has 366 days.