#abc315b. B - The Middle Day
B - The Middle Day
Score : points
问题描述
在 AtCoderLand 的日历中,一年包含 个月:第 1 月、第 2 月、……、第 月。第 个月包含了 天:第 1 天、第 2 天、……、第 天。
此外,一年中的天数是奇数,即 是奇数。
找出一年中位于正中间的日期是哪个月份的哪一天。 换句话说,将第 1 个月的第 1 天视为一年中的第一天,求出 和 ,使得一年中的第 天是第 个月的第 天。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
In the calendar of AtCoderLand, a year consists of months: month , month , , month . The -th month consists of days: day , day , , day .
Furthermore, the number of days in a year is odd, that is, is odd.
Find what day of what month is the middle day of the year.
In other words, let day of month be the first day, and find and such that the -th day is day of month .
Constraints
- All input values are integers.
- is odd.
Input
The input is given from Standard Input in the following format:
Output
Let the answer be day of month , and print it in the following format:
Sample Input 1
12
31 28 31 30 31 30 31 31 30 31 30 31
Sample Output 1
7 2
In this input, a year consists of days.
Let us find the middle day, which is the -th day.
- Months contain a total of days.
- Day of month is the -th day.
- Day of month is the -th day.
Thus, the answer is day of month .
Sample Input 2
1
1
Sample Output 2
1 1
Sample Input 3
6
3 1 4 1 5 9
Sample Output 3
5 3
update @ 2024/3/10 09:00:20