CF962A.Equator
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Polycarp has created his own training plan to prepare for the programming contests. He will train for n days, all days are numbered from 1 to n , beginning from the first.
On the i -th day Polycarp will necessarily solve ai 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 n ( 1≤n≤200000 ) — the number of days to prepare for the programming contests.
The second line contains a sequence a1,a2,…,an ( 1≤ai≤10000 ), where ai equals to the number of problems, which Polycarp will solve on the i -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 4 out of 7 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 6 out of 12 scheduled problems on six days of the training.