CF962A.Equator

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Polycarp has created his own training plan to prepare for the programming contests. He will train for nn days, all days are numbered from 11 to nn , beginning from the first.

On the ii -th day Polycarp will necessarily solve aia_i problems. One evening Polycarp plans to celebrate the equator. He will celebrate it on the first evening of such a day that from the beginning of the training and to this day inclusive he will solve half or more of all the problems.

Determine the index of day when Polycarp will celebrate the equator.

输入格式

The first line contains a single integer nn ( 1n2000001 \le n \le 200\,000 ) — the number of days to prepare for the programming contests.

The second line contains a sequence a1,a2,,ana_1, a_2, \dots, a_n ( 1ai100001 \le a_i \le 10\,000 ), where aia_i equals to the number of problems, which Polycarp will solve on the ii -th day.

输出格式

Print the index of the day when Polycarp will celebrate the equator.

输入输出样例

  • 输入#1

    4
    1 3 2 1
    

    输出#1

    2
    
  • 输入#2

    6
    2 2 2 2 2 2
    

    输出#2

    3
    

说明/提示

In the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve 44 out of 77 scheduled problems on four days of the training.

In the second example Polycarp will celebrate the equator on the evening of the third day, because up to this day (inclusive) he will solve 66 out of 1212 scheduled problems on six days of the training.

首页