#C689. Valid Date Checker

    ID: 50699 Type: Default 1000ms 256MiB

Valid Date Checker

Valid Date Checker

You are given a date string in the format dd-mm-yyyy. Your task is to determine whether the date is valid. A valid date must satisfy the following conditions:

  • The format is strictly dd-mm-yyyy, where d, m, and y represent day, month, and year respectively.
  • The day, month, and year are numeric and fit the calendar rules. For example, if m = 2 (February), the number of days is 28 in a common year and 29 in a leap year.
  • The year must be in the range \(1900 \leq y \leq Y\), where \(Y\) is the current year.

A year is a leap year if it is either divisible by 400 or divisible by 4 but not by 100. In mathematical terms, a year \(y\) is a leap year if:

\[ \left(y \bmod 400 = 0\right) \quad \text{or} \quad \left(y \bmod 4 = 0 \; \text{and} \; y \bmod 100 \neq 0\right). \]

Return True if the date is valid and False otherwise.

inputFormat

The input consists of a single line containing a date string in the format dd-mm-yyyy.

outputFormat

Output a single line: True if the date is valid according to the rules mentioned above, or False if it is not.

## sample
29-02-2020
True

</p>