#P1202. [USACO1.1] 黑色星期五 Friday the Thirteenth
[USACO1.1] 黑色星期五 Friday the Thirteenth
Description
It is Friday the th again. Does the th fall on Friday less often than on other days?
To answer this question, write a program that counts, for each month, how many times the th falls on each day of the week. Given a period of years, compute the counts for dates from January , to December , .
Here are some things you need to know:
- January , was a Monday.
- Months , , and have days; all other months except month have days. In a leap year, February has days; in a common year, February has days.
- A year divisible by is a leap year (, so is a leap year, but is not).
- The above rule does not apply to century years. A century year divisible by is a leap year; otherwise, it is a common year. Thus, , , , and are common years, while is a leap year.
Input Format
A single positive integer .
Output Format
Output, in order, the counts of Saturday, Sunday, Monday, Tuesday, Wednesday, Thursday, and Friday on which the th occurs. Print them on one line, separated by spaces.
20
36 33 34 33 35 35 34
Hint
Constraints
For of the testdata, .
Translation from NOCOW.
USACO Training Section .
Translated by ChatGPT 5
京公网安备 11011102002149号