Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"fmt"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	a := make([]float64, 10)
	for scanner.Scan() {
		info := strings.Split(scanner.Text(), ",")
		for j := 0; j < 10; j++ {
			a[j], _ = strconv.ParseFloat(info[j], 64)
		}
		v1, _ := strconv.ParseFloat(info[10], 64)
		v2, _ := strconv.ParseFloat(info[11], 64)
		sum := 0.0
		for i := 0; i < 10; i++ {
			sum += a[i]
		}
		match := v1 * ((sum/(v1+v2)))
		if match == 0 {
			fmt.Println(1)
		} else {
			sum = 0
			for k := 0; k < 10; k++ {
				sum += a[k]
				if match <= sum {
					fmt.Println(k+1)
					break
				}
			}
		}
	}
}

C++: #include<iostream>
using namespace std;


int main(){
		
	int km[10],v1,v2; char a;
	double length; int leng[11] ;
	while(1){
	if(cin.eof() ) break;
	for(int i=0;i<10;i++)
	cin >> km[i] >> a;
	cin >> v1 >> a >> v2;	
	leng[0] = 0;
	for(int k =0;k<10;k++)
	leng[k+1] = leng[k] + km[k];
	length = (double)leng[10] * ((double)v1 / ((double)v1 + (double)v2)); 
	for(int k=0;k<10;k++){
	if(leng[k] <= length && leng[k+1] >= length){
	cout << k + 1<<endl; break;
	}
	}

	
	
	}
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <string>
 
#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(int x=from;x<to;x++)
 
using namespace std;
 
 
int main(void){
 
int l[10] ,v1,v2;
char cc;
 
    while(cin >> l[0] ){
        rep2(i,1,10) cin >> cc >> l[i];
        cin >> cc >> v1 >> cc >> v2;
        int kr=0;
        rep(i,10) kr += l[i];
        double tm = kr * 1.0l / (v1 + v2);
        double km = v1 * tm;
        kr = 0;
        rep(i,10){
            kr += l[i];
            if(kr >= km){
                cout << i+1 << endl;
                break;
            }  
        }
//      printf("%f,%f kr=%d\n",tm,km,kr);
    }
    return 0;
     
     
}

C++: #include <iostream>
#include <cmath>
#include <vector>
#include <cstdio>
#include <algorithm>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define repp(i,r,n) for(int i=r;i<(int)n;i++)
using namespace std;
int in() {int x; cin >> x; return x;}

int main()
{
	int l[10];
	double v[2];
	while(scanf("%d",&l[0])!=EOF)
	{
		int m[99999]={};
		m[0]=1;
		for(int i=1;i<10;i++)scanf(",%d",&l[i]);
			char zzz;
		cin>>zzz>>v[0]>>zzz>>v[1];
		v[0]*=0.1;v[1]*=0.1;
		int now=0;
		for(int i=0;i<10;i++)
		{
			m[l[i]+now+1]++;
			now+=l[i];
		}
		for(int i=1;i<99999;i++)m[i]+=m[i-1];
			int nn=1;
		while(1)
		{
			nn+=(int)v[0];
			now-=(int)v[1];
			if(nn>now)
			{
				cout<<m[(nn+now)/2]<<endl;
				break;
			}
		}

	}

	return 0;

}

C++: #include<cstdio>
#include<algorithm>

using namespace std;
int main(void)
{
	double a[10];
	double v[2];
	double ans;
	double all = 0;
	double kari = 0;
	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],&a[9],&v[0],&v[1]) != EOF)
	{
		for(int i = 0;i < 10;i++) all += a[i];
		ans = (v[0] * all) / (v[0] + v[1]);
		if(ans == 0) printf("1\n");
		else
		{
			for(int i = 0;i < 10;i++)
			{
				kari += a[i];
				if(kari >= ans)
				{
					printf("%d\n",i+1);
					break;
				}
			}
		}
	}
	return 0;
}

C++: #include <cstdio>

int main()
{
        const int MAX = 10;
        float l[MAX];
        int v1, v2;

        scanf("%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%d,%d",
                                 &l[0], &l[1], &l[2], &l[3],
                                 &l[4], &l[5], &l[6], &l[7],
                                 &l[8], &l[9], &v1, &v2);
        float sumL = 0.0;
        for (float f: l) {
                sumL += f;
        }
        float vm1 = v1 / 60.0, vm2 = v2 /60.0;
        float l1 = 0.0, l2 = 0.0;
        while (l1 + l2 < sumL) {
                l1 += vm1;
                l2 += vm2;
        }
        float len = 0.0;
        int i = 0;
        while (len < l1) {
                len += l[i++];
        }
        printf("%d\n", i);

        return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
 
int main() {
  double l[10];
  char c;
   
  while(cin >> l[0] >> c) {
    // ????????¨??????1?????????
    int sum = l[0];
    for(int i=1; i<10; i++) cin >> l[i] >> c, sum += l[i];
    for(int i=0; i<10; i++) l[i] = l[i]/sum;
     
    // ???????????????1?????????
    double a, b;
    double left;
    cin >> a >> c >> b;
    left = a/(a+b);
     
    int t = 0;
    double L = 0.0;
    while( L < left ) {
      L += l[t++];
    }
    cout << t << endl;
  }
   
  return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
using namespace std;

int main(){
	int l[11],v1,v2,ans;
	double x;
	while(1){
		int sum=0,y=0;
		rep(i,0,10){
			scanf("%d,",&l[i]);
			sum+=l[i];
		}
		if(scanf("%d,%d",&v1,&v2)==EOF) break;
		x=(double)sum*v1/(v1+v2);
		rep(j,0,10){
			y+=l[j];
			if(y>=x){
				ans=j+1;
				break;
			}
		}
		cout<<ans<<endl;
	}
}

C++: #include <bits/stdc++.h>

using namespace std;

int l[10];
int a, b;

int main()
{
	while (~scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&l[0],&l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&a,&b)) {
		for (int i = 1; i < 10; ++i) l[i] += l[i - 1];
		double c = (double)l[9] / (a + b) * a;
		for (int i = 0; i < 10; ++i) if (c <= l[i]) { printf("%d\n", i + 1); break; }
	}
}

C++: #include <iostream>
#include <cstdio>
using namespace std;

int main()
{
	int l[10],v1,v2;
	while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&l[0],&l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&v1,&v2) !=EOF)
	{
		double ka = 0;
		int si = 0;
		for (int i = 0; i < 10; ++i)
			ka += l[i];
		ka = ka*v1/v2/2;
		int ans = 0;
		for (int i = 0; i < 10; ++i)
		{
			si += l[i];
			if(si >= ka)
			{
				ans = i + 1;
				break;
			}
		}
		cout << ans << endl;
	}
}

C++: #include <iostream>
#include <cmath>
using namespace std;

int main() {
	int l[10],v1,v2;
	int len;
	float len1,len2;
	
	
	while(len=0,scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&l[0],&l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&v1,&v2)+1){
		for(int i=0;i<10;++i)len+=l[i];
		
		len1=0;
		len2=len;
		
		while(fabs(len1 - len2) > 0.1 ){
			len1 += 0.01f * v1;
			len2 -= 0.01f * v2;
		}
		
		len2=0;
		for(int i=0;i<9;++i){
			if(len1 >= len2 && len1 <len2+l[i]){
				cout<<i+1<<endl;
				break;
			}
			len2+=l[i];
		}
		
	}
	
	return 0;
}

C++: #include <iostream>
using namespace std;

#define SIZE 10

int main() {
	int l[SIZE] = { 0 }, v1, v2;
	double s;
	char t;
	while (!cin.eof()) {
		s = 0;
		for (int i = 0; i < SIZE; i++) {
			cin >> l[i];
			cin >> t;

			s += l[i];
		}
		cin >> v1 >> t >> v2;
		s = s * v1 / (v1 + v2);

		for (int i = 0; i < 10; i++) {
			s -= l[i];
			if (s <= 0) {
				cout << i + 1 << endl;
				break;
			}
		}
	}
	return 0;
}

C++: #include <cstdio>
using namespace std;

int total;
int ls[10];
int vs[2];

int main() {
  while (1) {
    total = 0;
    for (int i=0; i<10; i++) {
      if (scanf("%d", &ls[i]) != 1) return 0;
      getchar();
      total += ls[i];
    }
    scanf("%d,%d", &vs[0], &vs[1]);

    double p = (double(vs[0])/(vs[0]+vs[1])) * total;
    int sum = 0;
    for (int i=0; i<10; i++) {
      sum += ls[i];
      if (sum >= p) {
        printf("%d\n", i+1);
        break;
      }
    }
  }
}

C++: #include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int l[10];
    int v1, v2;
    int passby; //上り電車が進んだ距離
    int num; //すれ違った区間の番号
    int length; //線路の長さ
    
    while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &l[0], &l[1], &l[2], &l[3], &l[4], &l[5], &l[6], &l[7], &l[8], &l[9], &v1, &v2) != EOF){
        for(int i = 0; i < 10; i++){
            length += l[i];
        }
        passby = length * v1 / (v1 + v2); //この式は上り電車と下り電車の移動時間が等しいという式の形を変えたもの
        
        int sum = 0; //sum:すれ違った区間の番号を調べるのに必要
        for(int i = 0; i < 10; i++){
            sum += l[i];
            if(passby == l[i]) num = l[i];
        }
        cout << num << endl;
    }
}