#B. [ABC315B] The Middle Day

    Type: Default 2000ms 1024MiB

[ABC315B] The Middle Day

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

[ABC315B] The Middle Day

题面翻译

在 AtCoder 的国度里,一年包含 MM 个月,分别是:11 月,22 月,\cdotsMM 月。第 ii 个月包含 DiD_i 天。

保证一年中的天数是奇数,即 D1+D2++DMD_1+D_2+\cdots+D_M 是奇数。

找出几月几日是一年的中间一天。

换种方式讲,令 1111 日为一年的第一天,找出 aabb 日使得 aabb 日是一年的第 (D1+D2++DM+1)÷2(D_1+D_2+\cdots+D_M+1)\div2 天。

题目描述

In the calendar of AtCoderLand, a year consists of M months: month 1, month 2, , month M. The i-th month consists of Di days: day 1, day 2, , day Di. Furthermore, the number of days in a year is odd, that is, D1+D2++DM is odd. Find what day of what month is the middle day of the year. In other words, let day 1 of month 1 be the first day, and find a and b such that the ((D1+D2++DM+1)/2)-th day is day b of month a.

输入格式

输入格式如下:

M M D1 D_1 D2 D_2 \dots DM D_M

输出格式

输出格式如下,a月b日为答案:

a a b b

样例 #1

样例输入 #1

12
31 28 31 30 31 30 31 31 30 31 30 31

样例输出 #1

7 2

样例 #2

样例输入 #2

1
1

样例输出 #2

1 1

样例 #3

样例输入 #3

6
3 1 4 1 5 9

样例输出 #3

5 3

提示

数据范围

输入都是正整数

  • 1  M  100 1\ \le\ M\ \le\ 100
  • 1  Di  100 1\ \le\ D_i\ \le\ 100
  • D1 + D2 +  + DM D_1\ +\ D_2\ +\ \dots\ +\ D_M 是奇数

9月19日周二晚上集训赛

Not Attended
Status
Done
Rule
IOI
Problem
8
Start at
2023-9-19 19:00
End at
2023-9-19 21:00
Duration
2 hour(s)
Host
Partic.
30