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<cstdio>

using namespace std;

int main(void){
	int ku[11],i,ans=0;
	float v1,v2,zen=0,hit;

	while((scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%f,%f",&ku[1],&ku[2],&ku[3],&ku[4],&ku[5],&ku[6],&ku[7],&ku[8],&ku[9],&ku[10],&v1,&v2))!=EOF){
			for(i=1;i<=10;i++)	zen+=ku[i];
			hit=zen/(v1+v2)*v1;
			for(i=1;i<=10;i++){
				ans+=ku[i];
				if(ans>=hit){
					printf("%d\n",i);
					break;
				}
			}
			zen=0;
			ans=0;
	}

	return 0;
}

C++: #include <cstdio>
int main(){
	int l[10];
	float v1, v2;
	while(~scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%f,%f",l,l+1,l+2,l+3,l+4,l+5,l+6,l+7,l+8,l+9,&v1,&v2)){

	float distance = 0, goal;
	for(int i=0;i<10;i++)distance+=l[i];
	goal = distance * v1 / (v1+v2);
	
	int a = 0, res;
	for(int i=0;i<10;i++){
		a += l[i];
		if(goal <= a){res = i + 1;break;}
	}
	printf("%d\n", res);
	}
}

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

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

C++: #include <iostream>
#include <vector>
#include <map>
#include <stack>
#include <list>
#include <queue>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <math.h>

#define PREP(i, m, n) for(int i = m; i < n; i++)
#define MREP(i, m, n) for(int i = m - 1; i >= n; i--)
using namespace std;

class train{
	public:
		int v;
		double vRatio;
		double distance;
		int currentSta;

		train(int v = 0, double vRatio = 0.0, double distance = 0.0, int currentSta = 0):v(v), vRatio(vRatio), distance(distance), currentSta(currentSta){}
		
		void wantVRatio(int other){
			vRatio = (double)v / ((double)v + (double)other);
		}

		void wantDistance(int railsum){
			distance = (double)railsum * vRatio;
		}
	private:

	protected:

};


int main(){
	while(1){
		map<int, int> rail;
		int railsum = 0;
		train up, down(0,0.0,0.0,10);

		if(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &rail[0], &rail[1], &rail[2], &rail[3], &rail[4], &rail[5], &rail[6], &rail[7], &rail[8], &rail[9], &up.v, &down.v) == EOF){
			break;
		}

		PREP(i, 0, 10){
			railsum += rail[i];
		}

		up.wantVRatio(down.v);
		down.wantVRatio(up.v);
		up.wantDistance(railsum);
		down.wantDistance(railsum);

		
		int uptmp = 0, downtmp = 0;
		PREP(i, up.currentSta, down.currentSta){
			up.distance -= rail[i];
			if(up.distance < rail[i]) {
				uptmp = i;
				break;
			}
		}

		MREP(i, down.currentSta, up.currentSta){
			down.distance -= rail[i];
			if(down.distance < rail[i]){
				downtmp = i;
				break;
			}
		}

		up.currentSta = uptmp;
		down.currentSta = downtmp;

		if((down.currentSta - up.currentSta) == 2){
			//この2の内訳は、インデックスが0~9までに対して問題の区間番号が1~10定義になっているので+1と
			//仮に各電車の区間番号が5,7だった場合、すれ違うのは6なので5+1のための+1
			cout << up.currentSta + 2 << endl;
		}
		else{
			//インデックスが0~9までに対して問題の区間番号が1~10定義になっているので+1
			cout << (up.currentSta > down.currentSta ? down.currentSta + 1 : up.currentSta + 1) << endl;
		}
	
	}
	return 0;
}

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

int main()
{
    int l[10] , v1 , v2 , n , cnt;
    double d , t;
    char ch;
    while(cin(>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF){
        n=0;
        for(int i=0;i<10;i++){
            n+=l[i];
        }
        t=n/(v1+v2);
        d=v1*t;    //列車1の動く距離
        cnt=0;
        while(d>0){
            d -= l[cnt];
            cnt++;
        }
        cout << cnt << endl;
    }
	return 0;
}

C++: #include <iostream>

using namespace std;

void solve()
{
	int l[10];
	int v[2];
	while(~scanf("%d",&l[0]))
	{
		for(int i = 1; i < 10; ++i)
		{
			scanf(",%d", &l[i]);
		}
		scanf(",%d,%d", &v[0], &v[1]);
		int sum = 0;
		for(int i = 0; i < 10; ++i)
		{
			sum += l[i];
		}
		double pos = sum * (double)v[0] / (v[0] + v[1]);
		sum = 0;
		int count = 0;
		while(pos > sum)
		{
			sum += l[count];
			count++;
		}
		cout << count << endl;
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include <iostream>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <cstdio>

using namespace std;

int main(){
	int l[10];
	int v[2];

	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], &v[0], &v[1]) != EOF){
		int sum = 0;
		double d;
		for(int i = 0; i < 10; i++){
			sum += l[i];
			l[i] = sum;
		}
		d = (double)v[0]*l[9]/(v[0]+v[1]);
		for(int i = 0; i < 10; i++){
			if(d <= l[i]){
				cout << i+1 << endl;
				break;
			}
		}
	}

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
  int a[10], v1, v2;
  while (~scanf("%d", &a[0])) {
    int dis = a[0];
    for (int i = 1; i < 10; i++) {
      scanf(",%d", &a[i]);
      dis += a[i];
    }
    scanf(",%d,%d", &v1, &v2);
    double t = (double)dis / (v1 + v2);
    double p = v1 * t;
    double sum = 0.0;
    for (int i = 0; i < 10; i++) {
      sum += a[i];
      if (p <= sum) {
        printf("%d\n", i + 1);
        break;
      }
    }
  }
}

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

using namespace std;

int main(int argc, char *argv[])
{
  int l[10];
  int v1,v2;
  int L;
  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++){
    L += l[i];
  }
  double d;
  d =(double)L*v1/(v1+v2);
  L =0;
  for(int i = 0;i < 10;i++){
    L += l[i];
    if(d <=L){
      printf("%d\n",i+1);
      break;
    }
  }
  }
  return 0;
}

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

int main()
{
	int len[10];
	int v1,v2;
	while( scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &len[0],&len[1],&len[2],&len[3],&len[4],&len[5],&len[6],&len[7],&len[8],&len[9],&v1,&v2) != EOF ){
		int accum[10] = {0};
		accum[0] = len[0];
		for(int i=1;i<10;i++){
			accum[i] += accum[i-1] + len[i];
		}
		
		// accum[9] は合計の距離
		double t = (double)accum[9]/(v1 + v2);
		double dist = (double) v1*t;
		for(int i=0;i<10;i++){
			if( dist < accum[i] ){
				cout<<i+1<<endl;
				break;
			}
		}
	}
	return 0;
}

C++: #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
#include<map>
using namespace std;

int main(){
    int mod=1000000007;
    int a,b,c;
    int l[10],v[2];
    while (scanf("%d,",&l[0])!=EOF) {
        int tmp=l[0];
        for (int i=1;i<10;++i){
            scanf("%d,",&l[i]);
            tmp+=l[i];
        }
        scanf("%d,%d",&v[0],&v[1]);
        double chk=1.0*tmp*(v[0]*1.0/(v[0]+v[1]));
        if (chk-floor(chk)>1e-10) chk=chk+1.0;
        chk=floor(chk);
        int cnt=int(chk);
        int t=0;
        for (int i=0;i<10;i++) {
            t+=l[i];
            if (t>=cnt) {
                printf("%d\n",i+1);
                break;
            }
        }
    }
    return 0;
}