Hide

Problem F
Leap Year

A year is 365 days, which is the time it takes for the Earth to go one revolution around the Sun... almost.

To account for this discrepancy, an additional day is added into the year every few years.

Luckily there exists an algorithm to check if a year is a leap year.

  1. If the year is evenly divisible by 4, go to step 2. Otherwise, go to step 5.

  2. If the year is evenly divisible by 100, go to step 3. Otherwise, go to step 4.

  3. If the year is evenly divisible by 400, go to step 4. Otherwise, go to step 5.

  4. The year is a leap year (it has 366 days).

  5. The year is not a leap year (it has 365 days).

Write a program that, given a year, checks if the year is a leap year.

Input

Input consists of one line containing one integer $y$, the year to check, where $-10^6 < y < 10^6$

Output

Output consists of one line containing True if the year is a leap year, otherwise False

Sample Input 1 Sample Output 1
1600
True
Sample Input 2 Sample Output 2
1900
False
Sample Input 3 Sample Output 3
2000
True
Sample Input 4 Sample Output 4
2020
True
Sample Input 5 Sample Output 5
2022
False

Please log in to submit a solution to this problem

Log in