P5711 [Shenji 3.Example 3] Leap Year Check

Description

Input a year and determine whether it is a leap year. If it is, output $1$; otherwise, output $0$. Since year $1582$, the definition of a leap year is: Common leap year: A Gregorian year that is a multiple of $4$ and not a multiple of $100$ is a leap year (for example, years $2004$ and $2020$ are leap years). Century leap year: If a Gregorian year is a whole hundred, it must also be a multiple of $400$ to be a leap year (for example, year $1900$ is not a leap year, and year $2000$ is a leap year).

Input Format

Input a positive integer $n$, representing the year.

Output Format

Output one line. If the input year is a leap year, output $1$; otherwise, output $0$.

Explanation/Hint

The testdata guarantees that $1582 \leq n \leq 2020$, and the year is a natural number. Translated by ChatGPT 5