Problems > Leap Year

Leap Year

Difficulty: 800 2000 ms 128 MB

math implementation

Is year Y a leap year in the Gregorian calendar? A year is a leap year if it is divisible by 4, except century years, which must be divisible by 400.

Input: one integer Y.

Output: YES or NO.

Constraints:

  • 1 ≤ Y ≤ 109

Sample Tests

Input 1
2024
Output 1
YES
Input 2
1900
Output 2
NO

Read the Editorial

Discussion (opens after you solve — no spoilers before)

No comments yet.

Submit Your Solution

Log in or create a free account to run and submit code.