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++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>

typedef long long ll;
using namespace std;

typedef pair<int,int> P;

void seek_lcs(int a,int b,int dp[10+1][10+1],int* num,int* base,vector<int>& idx){
	if(a==0 || b==0){
		return;
	}

	if(num[a] == base[b]){
		seek_lcs(a-1,b-1,dp,num,base,idx);
		idx.push_back(num[a]);
	}
	else{
		if(dp[a-1][b] >= dp[a][b-1]){
			seek_lcs(a-1,b,dp,num,base,idx);
		}
		else{
			seek_lcs(a,b-1,dp,num,base,idx);
		}
	}

}

int main()
{
	int T;
	int l[10];
	int v1,v2;
	while(~scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
		l,l+1,l+2,l+3,l+4,l+5,l+6,l+7,l+8,l+9,&v1,&v2)){
			double lb=0.0;
			double ub=1000000000000;

			int sum = 0;
			for(int i=0;i<10;i++) sum+=l[i];
			for(int i=0;i<100;i++){
				double md = (ub+lb)/2.0;
				if((md/3600.0)*v1 +(md/3600.0)*v2 > sum) ub = md;
				if((md/3600.0)*v1 +(md/3600.0)*v2 < sum) lb = md;
			}

			double dist_t = v1*lb/3600.0;

			double dist_l = 0;
			for(int i=0;i<10;i++){
				dist_l += (double)l[i];
				if(dist_l >= dist_t){
					cout << i+1 << endl;
					break;
				}
			}
			//printf("%f\n",ub);
			//printf("%f\n",lb);
	}
}

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 = 9; i >= 0; --i) if (c >= l[i]) { printf("%d\n", i + 2); break; }
    }
}

C++: #include <iostream>
#include <stdio.h>

using namespace std;

void solve()
{
	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 posA = 0.0;
		double posB = 0.0;
		for(int i = 0; i < 10; ++i)
		{
			posB += l[i] * 1000;
		}
		int speedA = v1;
		int speedB = v2;
		while(posA < posB)
		{
			posA += speedA;
			posB -= speedB;
		}
		int dist = 0;
		for(int i = 0; i < 10; ++i)
		{
			dist += l[i] * 1000;
			if(posA < dist)
			{
				cout << i + 1 << endl;
				break;
			}
		}
	}
}

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

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

int main(){
	int l[10];
	double v1, v2;
	char tmp;
	double place;

	while(cin >> l[0] >> tmp){
		place = l[0];
		for(int i=1; i < 10; i++){
			cin >> l[i] >> tmp;
			place += l[i];
		}
		cin >> v1 >> tmp >> v2;
		place = place * (v1 / (v1 + v2));
		for(int i=0; i < 10; i++){
			place -= l[i];
			if(place <= 0){
				cout << i+1 << endl;
				break;
			}
		}
	}
}

C++: #include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<cmath>
#include<algorithm>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<set>
using namespace std;
int main(){
	int ta[10],v1,v2;
	char xx;
	while(true){
	int sum=0;
	for(int i=0;i<10;i++){cin>>ta[i]>>xx;sum+=ta[i];}
	if(!(cin>>v1>>xx>>v2))break;
	double t=0.0;
	for(;;t+=0.001){
		if(v1*t+v2*t>=sum)break;
	}
	int ans=0;double tsum=0.0;
	for(int i=0;i<10;i++){
		if(tsum>v1*t)break;
	if(t*v1-tsum<=0.00001){break;}
	tsum+=ta[i];
	ans++;
	}
		cout<<ans<<endl;
	}

	return 0;
}

C++: 

#include<iostream>
#include<vector>

using namespace std;

int main(){
    vector<int> v(10);
    int sp1, sp2;
    double all=0;
    char k;

    while(cin>>v.at(0)){
        for(int i=1; i<10; i++){
            cin>> v.at(i);
        }
        cin>> sp1>>k >>sp2;

        for(int i=0; i<10; i++){
            all += v.at(i);
        }

        double hour = all/(sp1+sp2);
        double len = sp1*hour;

        int k = 0;
        while(len>0){
            len -= (double)v.at(k);
            k++;
        }

        cout<< k<< endl;
    }

    return 0;
}

C++: #include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){
    int l[10],v1,v2;
    while(scanf("%d",&l[0])!=EOF){
        for(int i=1;i<10;i++)scanf(",%d",&l[i]);
        scanf(",%d,%d",&v1,&v2);
        int sum=0;
        for(int i=0;i<10;i++)sum+=l[i];
        double x=(double)sum/(v1+v2);
        x*=v1;
        int ite=0;
        while(true){
            x-=l[ite];
            if(x<=0){
                cout<<ite+1<<endl;
                break;
            }
            ite++;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(){
	int d[10],sum=0,tmp=0,v1,v2;
	while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&d[0],&d[1],&d[2],&d[3],&d[4],&d[5],&d[6],&d[7],&d[8],&d[9],&v1,&v2)!=EOF){
		for(int i=0;i<10;++i)sum+=d[i];
		for(int i=0;i<10;i++){
			if(tmp>=(double)sum*(double)v1/((double)v1+(double)v2)){
				cout<<i<<"\n";
				break;
			}
			tmp+=d[i];
		}
	}
	return 0;
}

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

using namespace std;

double l[10],v1, v2;

int main()
{
    for (int i = 0; i < 10; i++)
    {
        scanf("%lf,", &l[i]);
    }
    for (int i = 0; i < 10; i++)
    {
        l[i] += ((i != 0) ? l[i - 1] : 0);
    }
    scanf("%lf,%lf\n", &v1, &v2);

    v2 += v1;
    double t = l[9] / v2;
    double dis = v1 * t;
    for( int i = 0; i < 10; i++ )
    {
        if( l[i] <= dis && dis <= l[i + 1] )
        {
            printf( "%d\n", i + 2 );
            return 0;
        }
    }
    printf( "%d\n", 10 );
    return 0;
}

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

int main(){
	char trash;
	double a[10];
	double v1, v2;
	while(cin >> a[0] >> trash){
		double x = a[0];
		for(int i = 1; i < 10; i++){
			cin >> a[i] >> trash;
			x = x+a[i];
		}
		cin >> v1 >> trash >> v2;
		x = x*v1/(v1+v2);
		for(int i = 0; i < 10; i++){
			x = x-a[i];
			if(x <= 0){
				cout << i+1 << endl;
				break;
			}
		}
	}
}