#P5716. Days in a Month

    ID: 18944 Type: Default 1000ms 256MiB

Days in a Month

Days in a Month

Given a year and a month, determine the number of days in that month. For February, a leap year is considered based on the formula: if \(year \bmod 400 = 0\) or (\(year \bmod 4 = 0\) and \(year \bmod 100 \neq 0\)), then February has 29 days; otherwise, it has 28 days.

inputFormat

Two integers are provided as input: the first is the year and the second is the month (separated by space).

outputFormat

Output a single integer representing the number of days in the given month.

sample

2020 2
29