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>
#include <string>
using namespace std;

int main()
{
    int l[10] , v1 , v2 , n , m;
    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>>ch){
        t=n/(v1+v2);
        d=v1*t;    //列車1の動く距離
        m=0;
        for(int i=0;i<10;i++){
            m+=l[i];
            if(m<d){
                cout << i+1 << endl;
                break;
            }
        }
    }
	return 0;
}

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

int main() {
  int l[10];
  int 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) {

    int sum = 0;
    for(int i = 0; i < 10; i++) {
      sum += l[i];
    }

    double L1 = (double)v1*sum/(v1+v2);

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

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

int main() {
    string s;
    while(cin >> s) {
        for(auto& c : s) {
            if(c == ',') c = ' ';
        }
        stringstream ss(s);
        vector<int> l(11), v(2);
        for(int i = 1; i <= 10; ++i) {
            int d; ss >> d;
            l[i] += l[i - 1] + d;
        }
        ss >> v[0] >> v[1];
        int mid = (l.back() * v[0] + v[0] + v[1] - 1) / (v[0] + v[1]);
        cout << (lower_bound(begin(l), end(l), mid) - begin(l)) << endl;
    }
}

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

using namespace std;

int main(void)
{
	double line[10];
	double v1,v2;

	while( scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&line[0],&line[1],&line[2],&line[3],&line[4],&line[5],&line[6],&line[7],&line[8],&line[9],&v1,&v2) != EOF ){

		double sum = 0;

		for( int i = 0;i < 10;i++ ){
			sum += line[i];
		}

		double time = sum / ( v1 + v2 );

		double dist = time * v1;


		for( int i = 0;i < 10;i++ ){
			dist -= line[i];

			if( dist <= 0 ){
				cout << i + 1 << endl;
				break;
			}
		}
	}

	return 0;
}

C++: #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cstdlib>

using namespace std;

inline int to_int(string s) {int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string to_str(T x) {ostringstream sout; sout << x; return sout.str();}

typedef long long ll;

int main()
{
	int L[16];
	int sum;
	int v1, v2;
	double crush;
	int ans;
	while(scanf("%d",&L[0]) != EOF)
	{
		sum = L[0];
		for(int i = 1; i < 10; i++)
		{
			scanf(",%d",&L[i]);
			sum += L[i];
		}
		scanf(",%d,%d", &v1, &v2);

		crush = sum * (v1 * 1.0/(v1+v2) );

		for(int i = 0; i < 10; i++)
		{
			crush -= L[i];
			if(crush <= 0)
			{
				ans = i+1;
				break;
			}
		}
		cout << ans << endl;
	} 
}

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

using namespace std;

bool input(int* l, int* v)
{
	char dummy;
	for (int i=0; i<10; i++) {
		if ( !(cin >> l[i]) ) return false;
		cin >> dummy;
	}
	for (int i=0; i<2; i++) {
		if ( !(cin >> v[i]) ) return false;
		if (i==0) cin >> dummy;
	}
	return true;
}

int main()
{
	int l[10];
	int v[2];
	while ( input(l, v) ) {
		int L = 0;
		for (int i=0; i<10; i++) L += l[i];
		float rate = static_cast<float>(v[0]) / static_cast<float>(v[0] + v[1]);
		int meet_pos = ceil(L * rate);
		
		//cout << "rate = " << rate << " meet_pos = " << meet_pos << endl;
		
		int meet_rail_num;
		int sum_of_length = 0;
		for (meet_rail_num = 0; sum_of_length < meet_pos; meet_rail_num++) {
			sum_of_length += l[meet_rail_num];
		}
		
		cout << meet_rail_num << endl;
	}
	
	return 0;
}

C++: #include<stdio.h>

int main(void){

	int k[20]={0},i=0,traina=0,trainb=0,sum=0,dec;
	double t=0,x=0;					//x=trainaÌÚ®£AtÍÔ
	
	while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&k[0],&k[1],&k[2],&k[3],&k[4],&k[5],&k[6],&k[7],&k[8],&k[9],&traina,&trainb) != EOF){
	
		
		
	/*	for(i=0;i<10;i++){				//æÔ£
			scanf("%d",&section[i]);
		}
	
		scanf("%d %d",&traina,&trainb);	*/	//ñÔ¬x

		for(i=0;i<10;i++){				//SÌÌ·³
			sum=k[i]+sum;
		}

		dec=traina+trainb;		//l1=v1t;l2=v2t;l=l1+l2;l/(v1+v2)=t;l=v1t+v2t lÍÚ®£AtÍÔÂ©é¶©ñ
		/*if(dec<0){
			dec=dec*(-1);
		}*/
		
		t=(double)sum/dec;	//·êá¤Ô
		x=(double)traina*t;	//·êá¢Êu
		printf("%d %d %f %f\n",sum,dec,x,t);														
		sum=0;
	
		for(i=0;i<10;i++){														
			if(sum>=x){
				break;
			}
			sum=k[i]+sum;
		}
			
		printf("%d\n",i);

		

	}
	return 0;
}

C++: #define _USE_MATH_DEFINES
 
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>

using namespace std;

int main(){
	int l[10];
	int v1, v2;
	char c;
	int d;

	while(cin >> l[0]){
		d=l[0];
		for(int i=1;i<10;i++){
			cin >> c >> l[i];
			d+=l[i];
		}
		cin >> c >> v1 >> c >> v2;

		double t = (double)d/(v1+v2);
		d=0;
		//cout << t<<endl;
		for(int i=0;i<10;i++){
			d+=l[i];
			//cout << v1*t <<" "<<d<<endl;
			if(v1*t <= d){
				cout << i+1 <<endl;
				break;
			}
		}
	}
	return 0;
}

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

using namespace std;

int main(){
  int i;
  long double closs, l[11], v[2], sum_len = 0.0,t[2][12]={};
  while(scanf("%Lf,",&l[1])!=EOF){
    sum_len=l[1];
    for(i=2;i<11;i++) {scanf("%Lf,",&l[i]);sum_len+=l[i];}
    scanf("%Lf,%Lf",&v[0],&v[1]);
    closs=sum_len/(v[0]+v[1]);
   long double sum_time[2]={};
    for(i=1;i<11;i++){
      t[0][i]=sum_time[0]+(l[i]/v[0]);
      t[1][11-i]=sum_time[1]+l[11-i]/v[1];
      sum_time[0]+=l[i]/v[0];
      sum_time[1]+=l[12-i]/v[1];
    }
    t[0][11]=t[1][0]=sum_time[0];
    for(i=0;i<12;i++){
      //cout<<t[0][i] << ' ' <<t[1][i]<<endl;
      t[0][i] = t[0][i]; t[1][i]=t[1][i];
      if(t[0][i] >= closs && t[1][i] <= closs){cout<<i<<endl; break;}
      //if(t[0][i] == closs && t[1][i] == closs) {cout<<i-1<<endl; break;}
    }
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>
#include <sstream>
#include <map>
 
using namespace std;
 
const double eps=1e-10;

int main()
{
	long long l[10];
	while(cin>>l[0]){
		l[0]*=1000;
		long long sum=l[0];

		char dummy;
		for(int i=1;i<10;i++){
			cin>>dummy>>l[i];
			l[i]*=1000;
			sum+=l[i];
		}
		double v1,v2;
		cin>>dummy>>v1>>dummy>>v2;

		v1/=3.6; v2/=3.6;

		//x1=v1*t x2=-v2*t+sum
		double x=v1*sum/(v1+v2);

		int L=0;
		for(int i=0;i<10;i++){
			L+=l[i];
//			cout<<"x="<<x<<endl<<"l="<<L<<endl;
			if(x<=L){
				cout<<i+1<<endl;
				break;
			}
		}


	}

	return 0;
}

C++: #include <stdio.h>

int main(){
double v1,v2,t,x,x2;
int a[10],i;
while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%lf,%lf",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],&a[9],&v1,&v2)!=EOF){
x=0;
x2=0;
for(i=0;i<10;i++){
x+=a[i];
}
t=(double)x/((double)v1+(double)v2)*(double)v1;
for(i=0;i<10;i++){
x2+=a[i];
if(x2>=t){
printf("%d\n",i+1);
break;
}
}
}
return 0;
}