Problem:


鉄道路線

複線（上りと下りが別の線路になっていてどこででもすれ違える）の鉄道路線があります。この路線には終端駅を含めて11 の駅があり、それぞれの駅と駅の間は図で示す区間番号で呼ばれています。

この路線の両方の終端駅から列車が同時に出発して、途中で停まらずに走ります。各区間の長さと2 本の列車の速度を読み込んで、それぞれの場合について列車がすれ違う区間の番号を出力するプログラムを作成してください。ただし、ちょうど駅のところですれ違う場合は、両側の区間番号のうち小さいほうの数字を出力します。また、列車の長さ、駅の長さは無視できるものとします。

Input

複数のデータセットが与えられる。各データセットは以下のような形式で与えられる。

l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,v1,v2

li (1 ≤ li ≤ 2,000) は区間 i の長さ(km)を表す整数である。v1 は区間 1 側の終端駅を出発した列車の速度(km/h)、v2 は区間 10 側の終端駅を出発した列車の速度(km/h)を表す整数である (1 ≤ v1, v2 ≤ 2,000)。

データセットの数は 50 を超えない。

Output

データセットごとに、列車がすれちがう区間の番号を１行に出力する。

Sample Input

1,1,1,1,1,1,1,1,1,1,40,60
1,1,1,1,1,3,3,3,3,3,50,50
10,10,10,10,10,10,10,10,10,10,50,49

Output for the Sample Input

4
7
6



Sample input:
1,1,1,1,1,1,1,1,1,1,40,60
1,1,1,1,1,3,3,3,3,3,50,50
10,10,10,10,10,10,10,10,10,10,50,49


Sample output:
4
7
6

Submission status: Wrong Answer

Solution code:
while True:
    try:
        l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,v1,v2=map(int,input().split(","))
        kyo=0
        for i in l1,l2,l3,l4,l5,l6,l7,l8,l9,l10:
            kyo +=i
        v=v1+v2
        x=kyo/v
        ans=v1*x
        flag=0
        for j in l1,l2,l3,l4,l5,l6,l7,l8,l9,l10:
            if ans>0:
                ans -=j
                flag +=1
            elif ans==0:
                print(flag)
                break
            elif ans<0:
                print(flag)
                break
    except:break

Submission status: Wrong Answer

Solution code:
while True:
    try:
        l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,v1,v2=map(int,input().split(","))
        kyo=0
        for i in l1,l2,l3,l4,l5,l6,l7,l8,l9,l10:
            kyo +=i
        v=v1+v2
        x=kyo/v
        ans=v1*x
        flag=0
        for j in l1,l2,l3,l4,l5,l6,l7,l8,l9,l10:
            if ans>0:
                ans -=j
                flag +=1
            elif ans==0:
                print(flag)
                break
            elif ans<0:
                print(flag)
                break
    except:break

Submission status: Wrong Answer

Solution code:
while True:
    try:
        l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,v1,v2=map(int,input().split(","))
        kyo=0
        for i in l1,l2,l3,l4,l5,l6,l7,l8,l9,l10:
            kyo +=i
        v=v1+v2
        x=kyo/v
        ans=v1*x
        flag=0
        for j in l1,l2,l3,l4,l5,l6,l7,l8,l9,l10:
            if ans>0:
                ans -=j
                flag +=1
            elif ans<=0:
                print(flag)
                break
    except:break

Submission status: Wrong Answer

Solution code:
while True:
    try:
        l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,v1,v2=map(int,input().split(","))
        kyo=0
        for i in l1,l2,l3,l4,l5,l6,l7,l8,l9,l10:
            kyo +=i
        v=v1+v2
        x=kyo/v
        ans=v1*x
        flag=0
        for j in l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,0:
            if ans>0:
                ans -=j
                flag +=1
                print(ans)
            else:
                print(flag)
                break
    except:break

Submission status: Wrong Answer

Solution code:
import sys

for s in sys.stdin:
	data = list(map(int, s.split(',')))
	dis = data[:10]
	v1, v2 = data[10], data[11]

	time = sum(dis) / (v1+v2)
	meetDis = v1 * time
	print(time, meetDis)

	for i in range(len(dis)):
		if meetDis <= 0:
			break

		meetDis -= dis[i]

	print(i)

Submission status: Wrong Answer

Solution code:
while 1:
    try:
        l=map(int,raw_input().split(','))
        v2=l.pop()
        v1=l.pop()
        p=v1*float(sum(l)/(v1+v2))
        for i in range(10):
            p-=l[i]
            if p<=0:
                print i+1
                break

    except:
        break

Submission status: Wrong Answer

Solution code:
import sys
def p(i):
    if(i==1):
        print("One")
    elif(i==2):
        print("Two")
    elif(i==3):
        print("Three")
    elif(i==4):
        print("Four")
    elif(i==5):
        print("Five")
    elif(i==6):
        print("Six")
    elif(i==7):
        print("Seven")
    elif(i==8):
        print("Eight")
    elif(i==9):
        print("Nine")
    elif(i==10):
        print("Ten")
a=[]
for i in range(10):
    a.append(-1)

for line in sys.stdin.readlines():
    a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], s1, s2=map(int,line.split(','))
    time=sum(a)/(s1+s2)
    if(s1<=s2):
        d=s1*time
        for i in range(10):
            if(d>0):
                d=d-a[i]
            else:
                p(i)
                break
    else:
        d=s2*time

        for i in range(9,0,-1):
            if(d>0):
                d=d-a[i]
               # print("d:",d)
            else:
                p(i+2)
                break

Submission status: Wrong Answer

Solution code:
import sys
def p(i):
    if(i==1):
        print("One")
    elif(i==2):
        print("Two")
    elif(i==3):
        print("Three")
    elif(i==4):
        print("Four")
    elif(i==5):
        print("Five")
    elif(i==6):
        print("Six")
    elif(i==7):
        print("Seven")
    elif(i==8):
        print("Eight")
    elif(i==9):
        print("Nine")
    elif(i==10):
        print("Ten")
a=[]
for i in range(10):
    a.append(-1)

for line in sys.stdin.readlines():
    a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], s1, s2=map(int,line.split(','))
    time=sum(a)/(s1+s2)
    if(s1<=s2):
        d=s1*time
        for i in range(10):
            if(d>0):
                d=d-a[i]
            else:
                print(i)
                break
    else:
        d=s2*time

        for i in range(9,0,-1):
            if(d>0):
                d=d-a[i]
               # print("d:",d)
            else:
                print(i+2)
                break

Submission status: Wrong Answer

Solution code:
import sys
a=[]
for i in range(10):
    a.append(-1)

for line in sys.stdin.readlines():
    a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], s1, s2=map(int,line.split(','))
    time=sum(a)/(s1+s2)
    if(s1<=s2):
        d=s1*time
        for i in range(10):
            if(d>0):
                d=d-a[i]
            else:
                print(i)
                break
    else:
        d=s2*time

        for i in range(9,0,-1):
            if(d>0):
                d=d-a[i]
               # print("d:",d)
            else:
                print(i+2)
                break

Submission status: Wrong Answer

Solution code:
while True:
    try:
        l = list(map(int, input().split(',')))
    except:
        break
    d = sum(l[:10]) * l[10] / (l[10] + l[11])
    for i in range(10):
        if sum(l[:i]) >= d:
            break
    print(i)

Submission status: Wrong Answer

Solution code:
while True:
    try:
        s = input().split(',')
    except EOFError:
        break
    arrL = [int(s[i]) for i in range(10)]
    v1 = int(s[10])
    v2 = int(s[11])
    L = sum(arrL)
    l = L*v1/(v1+v2)
    d = 0
    for i in range(len(arrL)):
        if l <= d:
            print(i)
            break
        d += arrL[i]

Submission status: Wrong Answer

Solution code:
while True:
    try:
        A = list(map(int,input().split(',')))
    except EOFError:
        break
    V1 = A [-2]
    V2 = A [-1]
    del A [-1]
    del A [-1]

    for i in range(len(A)):
        A [i] *= V1 + V2

    point = sum(A) // (V1 + V2) * V1
    print(point)
    for i in range(len(A)):
        if sum(A [0:i + 1]) >= point:
            print(i + 1)
            break

Submission status: Wrong Answer

Solution code:
import sys
for line in sys.stdin:
    v = list(map(int, line.split(",")))
    k = [sum(v[:i]) for i,j in enumerate(v[:-1])]
    l = v[-2]/(v[-1]+v[-2]) * k[-1]
    n = [a-l if a-l >= 0 else 1e10 for a in k]
    print(n)
    print(n.index(min(n)))

Submission status: Wrong Answer

Solution code:
while True:
    try:
        inp = list(map(int, input().split(",")))
        l = inp[0:10]
        l_all = sum(l)
        v1 = inp[10]
        v2 = inp[11]
        l_pass = l_all*v1/(v1 + v2)
        for i in range(10):
            if sum(l[:i]) >= l_pass:
                print(i)
                break
    except:
        break

Submission status: Wrong Answer

Solution code:
while True :
	try:
		x=[int(i) for i in input().split(",")]
		Len=x[:-2]
		ve=x[len(x)-2:]
		sum_ve=sum(ve)
		k=sum(Len)/sum_ve
		count=0
		for i in range(len(Len)):
			if count<k*ve[0]:
				count+=Len[i]
			else:
				print(i)
				break
	except EOFError:
		break

Submission status: Wrong Answer

Solution code:
while True:
    try:
        l = list(map(int, input().split(",")))
    except:
        break
    sum_l = sum(l[:10])
    M = sum_l*l[10]/(l[10] + l[11])
    for i in range(10):
        if M <= 0:
            print(i)
            break
        M -= l[i]

Submission status: Wrong Answer

Solution code:
import sys
for line in sys.stdin.readlines():
    line=map(int,line.strip().split(","))
    l,v1,v2=line[0:10],line[10],line[11]
    dist=(sum(l)+0.0)/(v1+v2+0.0)*v1
    for i in xrange(10):
        if sum(l[:i])>=dist:
            print i
            break

Submission status: Wrong Answer

Solution code:
import sys
def solve(l,v1,v2):
    dist=sum(l)/(v1+v2)*v1
    for i in range(10):
        if sum(l[:i])>=dist:
            return i
    return 0
for line in sys.stdin.readlines():
    line=map(float,line.strip().split(","))
    l,v1,v2=line[0:10],line[10],line[11]
    print solve(l,v1,v2)

Submission status: Wrong Answer

Solution code:
import sys

def main():
	for line in sys.stdin:
		data = map(int, line.strip().split(','))
		print analyze(data)

def analyze(data):
	lengths = data[:10]

	D = sum(lengths)

	v1 = data[10]
	v2 = data[11]

	mp = 1.0 * v1 / (v1 + v2) * D

	print "D = " + str(D)
	print "mp = " + str(mp)
	print "v1 = " + str(v1)
	print "v2 = " + str(v2)

	s = 0
	for i in xrange(10):
		s += lengths[i]
		if mp <= s:
			return i + 1

	return -1


main()

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin:
    po = [int(i) for i in line.split(",")]
    l = [0]
    for i in range(10):
        l.append(l[-1] + po[i])
    v1,v2 = po[10:]
    t = l[-1] / (v1+v2)
    for i in range(10):
        if l[i] < v1*t < l[i+1]:
            print(i+1)
            break
        elif l[i] == v1*t:
            print(i)
            break

Submission status: Accepted

Solution code:
from sys import stdin
import bisect

while(True):
    try:
        *ls,v1,v2 = list(map(int,stdin.readline().split(",")))
        rs = [sum(ls[:i+1]) for i in range(len(ls))]
        idx = bisect.bisect_left(rs,rs[-1]*v1/(v1+v2))
        print(idx+1)
    except:
        break

Submission status: Accepted

Solution code:
while True:
    try:
        l = map(int, raw_input().split(","))
        v1 = l.pop(10)
        v2 = l.pop(10)
        p = v1*float(sum(l))/(v1+v2)
        for i in range(10):
            p -= l[i]
            if p <= 0:
                print i+1
                break
    except:
        break

Submission status: Accepted

Solution code:
while True:
    try:
        l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,v1,v2=map(int,input().split(","))
        kyo=0
        for i in l1,l2,l3,l4,l5,l6,l7,l8,l9,l10:
            kyo +=i
        v=v1+v2
        x=kyo/v
        ans=v1*x
        flag=0
        for j in l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,0:
            if ans>0:
                ans -=j
                flag +=1
            else:
                print(flag)
                break
    except:break

Submission status: Accepted

Solution code:
while True:
    try:
        n = list(map(int, input().split(',')))
        v2, v1 = n.pop(), n.pop()
        dist = sum(n) * (v1 / (v1 + v2))
        total = 0
        ans = 0
        while total < dist:
            total += n[ans]
            ans += 1
        print(ans)
    except:
        break

Submission status: Accepted

Solution code:
while True:
  try:
    line = map(int, raw_input().split(","))
  except:
    break
  sum = 0
  rail = []
  for x in line[0:10]:
    sum += x
    rail.append(sum)
  cross = sum * (line[10] * 1.0 / (line[10] + line[11]))
  for i, length in enumerate(rail):
    if cross <= length:
      print i+1
      break

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

for s in sys.stdin:
  d = map(float, s.split(","))
  dl,v1,v2 = d[:-2],d[-2],d[-1]
  L = sum(dl)
  x = L/(1+v2/v1)
  m = 0
  for i in range(len(dl)):
    m += dl[i]
    if m >= x: print i+1; break

Submission status: Accepted

Solution code:
import sys
f = sys.stdin

for line in f:
    line = list(map(int, line.split(',')))
    l = line[:10]
    v1, v2 = line[10:]
    for i in range(1, len(l)):
        l[i] += l[i - 1]
    t = l[-1] / (v1 + v2)
    dist = v1 * t
    for i in range(len(l)):
        if l[i] >= dist:
            print(i + 1)
            break

Submission status: Accepted

Solution code:
import sys
for dataset in sys.stdin:
    dataset=map(int,dataset.split(","))
    v2=dataset.pop()
    v1=dataset.pop()
    L=sum(dataset)
    s=L/float(v1+v2)
    cross=v1*s
    
    banti=0
    for i in dataset:
        banti+=1
        cross-=i
        if cross<=0:
            print banti
            break

Submission status: Accepted

Solution code:
def tokyo():
    t = float(sum(station_lis)) / (v1 + v2)
    x = v1 * t
    total = 0
    for index, length in enumerate(station_lis):
        total += length
        if x <= total:
            print index+1
            break

while True:
    try:
        input_line = [int(char) for char in raw_input().split(',')]
        station_lis = input_line[:10]
        v1 = input_line[-2]
        v2 = input_line[-1]
        tokyo()
    except EOFError:
        break

Submission status: Accepted

Solution code:
import sys

for line in sys.stdin:
    ll = list(map(int, line.split(',')))
    s = ll[:10]
    v1, v2 = ll[10], ll[11]
    p = sum(s) / (v1 + v2) * v1

    ss = 0
    for i, l in enumerate(s):
        ss += l
        if ss >= p:
            print(i + 1)
            break

Submission status: Accepted

Solution code:
import sys

for s in sys.stdin:
	data = list(map(int, s.split(',')))
	dis = data[:10]
	v1, v2 = data[10], data[11]

	for i in range(1, len(dis)):
		dis[i] += dis[i-1]

	time = dis[-1] / (v1+v2)
	meetDis = v1 * time

	for i in range(len(dis)):
		if dis[i] >= meetDis:
			print(i+1)
			break

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin.readlines():
  l = [int(i) for i in line.split(',')]
  v2 = l.pop()
  v1 = l.pop()
  d = sum(l) * v1 / (v1+v2)
  a = 0
  c = 0
  for i in l:
    a += i
    c += 1
    if d <= a:
      print(c)
      break

Submission status: Accepted

Solution code:
while 1:
    try:
        l=map(int,raw_input().split(','))
        v2=l.pop()
        v1=l.pop()
        p=v1*float(sum(l))/(v1+v2)
        for i in range(10):
            p-=l[i]
            if p<=0:
                print i+1
                break

    except:
        break

Submission status: Accepted

Solution code:
from math import *
PI = 3.1415926535898
while True:
	try:
		rd = map(float, raw_input().strip().split(','))
		v1 = rd[10]
		v2 = rd[11]
		rd = rd[:-2]
		total = 0
		for x in rd:
			total += x
		t = total / (v1+v2) * v1
		pas = 0
		i = 0
		while pas < t:
			pas += rd[i]
			i += 1
		print i
	except EOFError:
		break

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
import sys


def solve(ls, v1, v2):
    lsum = sum(ls)
    d1 = v1 * lsum / (v1 + v2)
    d = 0.0
    for i in range(len(ls)):
        d += ls[i]
        if d >= d1:
            break
        else:
            continue
    return i + 1


if __name__ == "__main__":
    for line in sys.stdin:
        vals = array.array("d", map(float, line.split(",")))
        ls = vals[:10]
        v1, v2 = vals[-2:]
        print(solve(ls, v1, v2))

Submission status: Accepted

Solution code:
import sys

for line in sys.stdin:
    s = map(int, line.split(','))
    l = s[0:10]
    v1 = s[10]
    v2 = s[11]
    d = 1.0*sum(l)*v1/(v1+v2)
    t = 0
    for i in xrange(10):
        t += l[i]
        if t >= d:
            print i+1
            break

Submission status: Accepted

Solution code:
#encoding=utf-8

import sys
for i in sys.stdin:
	ans, num = 0.0, []
	num = map(int, i.split(","))
	x, y = float(num[10]), float(num[11])
	del num[10:12]
#	print sum(num)*(x/(x+y)), sum(num)*(y/(x+y))
	for i in xrange(10):
		ans += num[i]
#		print i,ans, sum(num)*(x/(x+y))
		if ans >= (sum(num)*(x/(x+y))):
			break
	print i + 1

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys
from decimal import *

for line in sys.stdin:
    L = map(int, line.split(','))
    v1 = L.pop(10)
    v2 = L.pop(10)
    sum_L = sum(L)
    t = float(sum_L)*float(v1)/float(v1+v2)
    i = 0
    while t > 0:
        t -= L[i]
        i += 1
    print i

Submission status: Accepted

Solution code:
import sys
ds = sys.stdin.readlines()
for d in ds:
    L = list(map(int, d.split(',')))
    l = sum(L[:-2])
    t = l/(L[-1] + L[-2])
    x = t * L[-2]
    for i in range(10):
        x = x - L[i]
        if x <= 0:
            print(i+1)
            break

Submission status: Accepted

Solution code:
while True:
    try:
        l = list(map(int, input().split(',')))
    except:
        break
    d = sum(l[:10]) * l[10] / (l[10] + l[11])
    for i in range(1,11):
        if sum(l[:i]) >= d:
            break
    print(i)

Submission status: Accepted

Solution code:
try:
    while 1:
        lv = list(map(int, input().split(',')))
        l = lv[:-2]
        v1, v2 = lv[-2:]

        s = sum(l) / (v1 + v2) * v1
        spam = 0
        for i in range(10):
            spam += l[i]
            if spam >= s:
                print(i + 1)
                break
except:
    pass

Submission status: Accepted

Solution code:
while True:
    try:
        s = list(map(int, input().split(',')))
    except:
        break
    arrL = [s[i] for i in range(10)]
    v1, v2 = s[10], s[11]
    l = sum(arrL) * (v1 / (v1 + v2))
    total = 0
    ans = 0
    while total < l:
        total += arrL[ans]
        ans += 1
    print(ans)

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin:
	l = list(map(int, line.split(',')))
	v1, v2 = l[10], l[11]
	sumlen = sum(l[:10])
	x = v1 * sumlen / (v1 + v2)
	temp_len = 0
	for i in range(10):
		temp_len += l[i]
		if x <= temp_len:
			print(i + 1)
			break

Submission status: Accepted

Solution code:
while True:
    try:
        line = input()
        l = list(map(int, line.split(',')))[0:10]
        v1, v2 = list(map(int, line.split(',')))[10:12]
    except:
        break
    l = list(map(lambda x: x / sum(l), l))
    x = v1 / (v1 + v2)
    for i in range(10):
        if x <= sum(l[:i + 1]):
            print(i + 1)
            break

Submission status: Accepted

Solution code:
while 1:
    try:
        ds = map(int, raw_input().split(','))
        d = [sum(ds[:i + 1]) for i in xrange(10)]
        t = sum(ds[:10]) / float(ds[10] + ds[11])
        s = ds[10] * t
        for i, j in enumerate(d):
            if j >= s:
                print i + 1
                break
    except:
        break

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin:
#while True:
#	line=raw_input()
	l=map(int,line.split(","))
	dis=l[10]/float(l[10]+l[11])*sum(l[:10])
	suml=0
	for i in xrange(10):
		suml+=l[i]
		if dis<=suml:
			print i+1
			break

Submission status: Accepted

Solution code:
while True:
    str=''
    try:
        str=input()
    except:
        break
       
    lens=list(map(int,str.split(',')))
    v1=lens[10]
    v2=lens[11];
    lens=lens[0:10]
    rsum=sum(lens)
    lsum=0
    ans=0
    for i in range(10):
        lsum+=lens[i]
        rsum-=lens[i]
        if(lsum*v2>=rsum*v1):
            ans=i+1
            break
    print(ans)

Submission status: Accepted

Solution code:
while True:
    try:
        dis = 0
        kyori = []
        Data = list(map(int,input().split(",")))
        for i in range(10):
            dis += Data[i]
            kyori.append(dis)
        Ad = dis * Data[10] / (Data[10] + Data[11])
        for j in range(9):
            if kyori[j] < Ad < kyori[j + 1]:
                print(j + 2)
            elif kyori[j] == Ad:
                print(j + 1)

    except EOFError:
        break

Submission status: Accepted

Solution code:
import sys
from itertools import accumulate


if __name__ == '__main__':
    # ??????????????\???
    for line in sys.stdin:
        data = [int(x) for x in line.strip().split(',')]
        # data = [1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 50, 50]

        # ??????????????????
        v1 = data[-2]
        v2 = data[-1]
        data = data[:-2]

        # ??????????????¢0??¨????????????????????§????´?????????¢????¨??????????
        acc = list(accumulate(data))
        total_distance = acc[-1]  # ???????????§????????????????????¢
        meeting_point = total_distance * v1 / (v1 + v2)  # ???????????????????????????????????????????????§???v1??¨v2????????????????????´?????§????????????

        # acc[]??????i+1????????????????????????????????????????????????????????¢?????\??£??????????????§??????????????¢?????????????????????????????\??????????????¨???????????????
        ans = 1
        for i, distance in enumerate(acc):
            if distance >= meeting_point:
                ans = i + 1
                break

        # ???????????¨???
        print(ans)

Submission status: Accepted

Solution code:
def get_data():
    data = input().split(',')
    l = []
    for i in range(10):
        l.append(int(data[i]))
        v1,v2 = int(data[10]),int(data[11])
    return v1,v2,l

def meet_point(v1,v2,l):
    l_total = 0
    for i in range(10):
        l_total += l[i]
    t = l_total/(v1+v2)
    p = v1*t
    res = 0
    for i in range(10):
        res += l[i]
        if p <= res:
            return i+1

while True:
    try:
        v1,v2,l = get_data()
        print(meet_point(v1,v2,l))
    except EOFError:
        break

Submission status: Accepted

Solution code:
while 1:
    try:l=list(map(int,input().split(',')))
    except:break
    b,a=l.pop(),l.pop()
    t=a*(sum(l)/(a+b))
    m=0
    for i in range(10):
        if 0<t-m<l[i]:i+=1;break
        elif not t-m:break
        else:m+=l[i]
    print(i)

Submission status: Accepted

Solution code:
while True:
    try:
        v = list(map(int, input().split(',')))
        l =[0] + v[:10]
        v1 = v[-2]
        v2 = v[-1]
        t = float(sum(l)) / (v1 + v2)
        d = t * v1

        for i in range(1,11):
            d -= l[i]
            if d <= 0:
                break
        print(i)

    except EOFError:
        break

Submission status: Accepted

Solution code:
while True:
    try:
        A = list(map(int,input().split(',')))
    except EOFError:
        break
    V1 = A [-2]
    V2 = A [-1]
    del A [-1]
    del A [-1]

    for i in range(len(A)):
        A [i] *= V1 + V2

    point = sum(A) // (V1 + V2) * V1
    for i in range(len(A)):
        if sum(A [0:i + 1]) >= point:
            print(i + 1)
            break

Submission status: Accepted

Solution code:
while True:
    try:
        inlist = list(map(int,input().split(",")))
        v2 = inlist.pop()
        v1 = inlist.pop()
        time = sum(inlist)/(v1+v2)
        length = time*v1
        for i in range(11):
            if length<=sum(inlist[:i]): print(i); break
    except EOFError: break

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys
import os

for s in sys.stdin:
    lst = list(map(int, s.split(',')))
    L = lst[:-2]
    v1 = lst[-2]
    v2 = lst[-1]

    l = sum(L)
    t = l / (v1 + v2)

    x = v1 * t
    len_sum = 0
    for i, l in enumerate(L):
        len_sum += l
        if x <= len_sum:
            print(i+1)
            break

Submission status: Accepted

Solution code:
while True :
    try :
        temp = [int(_) for _ in input().split(',')]
        length, x, y = 0, 0, 0
        for _ in temp[:10] : length += _
        y = (length * temp[-1]) / (temp[-1] + temp[-2])
        x = length - y
        for number, _ in enumerate(temp[:10]) : 
            if x - _ >= 0 : x -= _
            else : 
                if x == 0 : break
                else : 
                    number += 1    
                    break
        print(number)
    except : break

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin:
    v = list(map(int, line.split(",")))
    k = [sum(v[:i]) for i,j in enumerate(v[:-1])]
    l = v[-2]/(v[-1]+v[-2]) * k[-1]
    n = [a-l if a-l >= 0 else 1e10 for a in k]
    print(n.index(min(n)))

Submission status: Accepted

Solution code:
while True:
    try:
        l = list(map(int, input().split(',')))
    except:
        break
    d, v1, v2 = sum(l[:10]), l[10], l[11]
    t = 0
    m = 0
    for i, x in enumerate(l[:10]):
        t = x / v1
        m += t * v2
        if m + sum(l[:i+1]) >= d:
            print(i+1)
            break

Submission status: Accepted

Solution code:
from itertools import accumulate
while True:
    try:
        data = list(map(int, input().split(',')))
        l = data[0:10]
        v1 = data[10]
        v2 = data[11]

        l = list(accumulate(l))
        d = l[9] / (v1 + v2) * v1
        l.insert(0, 0)
        for i in range(len(l)):
            if l[i] < d <= l[i+1]:
                print(i+1)
                break
    except:
        break

Submission status: Accepted

Solution code:
while True:
    try:
        inp = list(map(int, input().split(",")))
        l = inp[0:10]
        l_all = sum(l)
        v1 = inp[10]
        v2 = inp[11]
        l_pass = l_all*v1/(v1 + v2)
        for i in range(11):
            if sum(l[:i]) >= l_pass:
                print(i)
                break
    except:
        break

Submission status: Accepted

Solution code:
def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = list(get_input())
for ll in range(len(N)):
    a = [int(i) for i in N[ll].split(",")]
    l = []
    totalLen = 0
    for i in range(10):
        l.append(a[i])
        totalLen += a[i]
    v1 = a[10]
    v2 = a[11]
    midPoint = totalLen*v1/(v1+v2)
    ans = 10
    for i in range(10):
        midPoint -= l[i]
        if midPoint <= 0:
            ans = i+1
            break
    print(ans)

Submission status: Accepted

Solution code:
import sys
for e in sys.stdin:
 e=list(map(int,e.split(',')))
 v=sum(e[:10])*e[10]/(e[10]+e[11])
 for i in range(10):
  if v<=sum(e[:i+1]):print(i+1);break

Submission status: Accepted

Solution code:
import sys
for e in sys.stdin:
 e=list(map(int,e.split(',')))
 for i in range(10):
  if sum(e[:10])*e[10]/(e[10]+e[11])<=sum(e[:i+1]):print(i+1);break

Submission status: Accepted

Solution code:
while True :
	try:
		x=[int(i) for i in input().split(",")]
		Len=x[:-2]
		ve=x[len(x)-2:]
		sum_ve=sum(ve)
		k=sum(Len)/sum_ve
		count=0
		for i in range(len(Len)):
			count+=Len[i]
			if count>=k*ve[0]:
				print(i+1)
				break
	except EOFError:
		break

Submission status: Accepted

Solution code:
while True:
    try:
        l = list(map(int, input().split(",")))
    except:
        break
    sum_l = sum(l[:10])
    M = sum_l*l[10]/(l[10] + l[11])
    for i in range(10):
        M -= l[i]
        if M <= 0:
            print(i+1)
            break

Submission status: Accepted

Solution code:
while 1:
	ans = 0
	try: l=list(map(int,input().split(',')))
	except: break
	s2,s1=l.pop(),l.pop()
	t=sum(l)/(s1+s2)
	x=s1*t
	for i in range(10):	
		ans = ans + l[i]
		if ans >= x: break
	print(i+1)

Submission status: Accepted

Solution code:
import sys
def d(o):
 m=o[-2]/sum(o[-2:])
 l=sum(o[:-2])
 p=lambda x:(sum(o[:x])/l)
 for i in range(1,len(o[:-2])+1):
  if p(i)>=m:return i

l=[list(map(int,t.split(","))) for t in sys.stdin]
[print(i) for i in [d(o) for o in l]]

Submission status: Accepted

Solution code:
while True:
  try:
    lst = list(map(int, input().split(",")))
    v2 = lst.pop()
    v1 = lst.pop()

    cum_sum = [0]
    acc = 0

    for l in lst:
      acc += l
      cum_sum.append(acc)

    cross = acc * v1 / (v1 + v2)

    for i in range(1, 11):
      if cross <= cum_sum[i]:
        print(i)
        break

  except EOFError:
    break

Submission status: Accepted

Solution code:
# AOJ 0034 Railway Lines
# Python3 2018.6.22 bal4u

while 1:
	try: a = list(map(int, input().split(',')))
	except: break
	pos = [0]*12
	v1, v2 = a[10], a[11]
	for i in range(10): pos[i+2] = pos[i+1] + a[i]
	L = pos[11]
	pq = (L*v1) // (v1 + v2);
	pr = (L*v1) % (v1 + v2);
	i = 10
	while pq < pos[i]: i -= 1
	if pq == pos[i] and pr == 0: i -= 1
	print(i)

Submission status: Accepted

Solution code:
import sys

for line in iter(sys.stdin.readline, ''):
  t = line.strip().split(',')
  l = [int(x) for x in t[:10]]
  v = [int(x) for x in t[10:]]
  time = float(sum(l)) / float(sum(v))
  dis = time * float(v[0])

  s = 0
  for (i, x) in enumerate(l):
    s += x
    if s >= int(dis):
      print i + 1
      break

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

import sys


def railway_lines(arg):
    b = arg.pop()
    a = arg.pop()
    base = a + b
    rail = []
    for area_number, length in enumerate(arg):
        area_number += 1
        rail += [area_number] * (length * base)
    a_last = 0
    while rail:
        for i in xrange(a):
            a_last = rail.pop(0)
        for i in xrange(b):
            rail.pop()
    return a_last


def main():
    params = [map(int, line.split(",")) for line in sys.stdin.readlines()]
    for param in params:
        print railway_lines(param)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin.readlines():
    line=map(int,line.strip().split(","))
    l,v1,v2=line[0:10],line[10],line[11]
    dist=(sum(l)+0.0)/(v1+v2+0.0)*v1
    for i in xrange(11):
        if sum(l[:i])>=dist:
            print i
            break

Submission status: Accepted

Solution code:
while True:
    try:
        values = [int(i) for i in raw_input().split(',')]
    except:
        break
    kukaku = values[:-2]
    aspeed = values[10]
    bspeed = values[11]
    nagasa = reduce(lambda x,y:x+y,kukaku)
    jikan  = float(nagasa) / (aspeed + bspeed)
    ekinag = map(lambda x:reduce(lambda x,y:x+y,kukaku[:x]),xrange(1,11))
    for i, j in enumerate(ekinag):
        if(j >= jikan * aspeed):
            print i+1
            break

Submission status: Accepted

Solution code:
import sys
def solve(l,v1,v2):
    dist=sum(l)/(v1+v2)*v1
    for i in range(11):
        if sum(l[:i])>=dist:
            return i
    return 0
for line in sys.stdin.readlines():
    line=map(float,line.strip().split(","))
    l,v1,v2=line[:10],line[10],line[11]
    print solve(l,v1,v2)

Submission status: Accepted

Solution code:
from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
from sys import stdin

for line in stdin:
    L = [int(s) for s in line.split(',')]
    cross_over = L[10] * sum(L[:10]) / (L[10] + L[11])
    d = 0
    for i, xi in enumerate(L[:10]):
        d += xi
        if cross_over <= d:
            break
    print(i+1)

Submission status: Accepted

Solution code:

import sys


def intersect(len, v1, v2):
    t = len / (v1 + v2)
    return v1 * t

def section_number(sections, position):
    i = [0.0]
    dis = reduce((lambda acc, d: list_append(acc, acc[-1] + d)), sections, i)
    s = 0
    for d in dis:
        if position <= d:
            return s
        s += 1

def list_append(lis, a):
    lis.append(a)
    return lis



for line in sys.stdin:
    sections = map(float, line.split(','))
    v2 = sections.pop()
    v1 = sections.pop()
    length = sum(sections)
    position = intersect(length, v1, v2)
    print section_number(sections, position)