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 <stdio.h>

int main(int argc, char **argv)
{
	int a[11], i, j;
	float x[11], y[11], t1, t2, v1, v2, l, l1, l2;
	
	while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%f,%f",
				&a[1], &a[2], &a[3], &a[4], &a[5], &a[6], &a[7], &a[8], &a[9], &a[10], &v1, &v2) != EOF){
		for(i = 1, l = 0; i < 11; i++){
			x[i] = (float)a[i]/v1;
			y[i] = (float)a[i]/v2;
			l += a[i];
		}
		
		t1 = t2 = l1 = l2 = 0;
		j = 10;
		i = 1;
		while(l > l1+l2){
			if(t1 < t2){
				l1 += x[i]*v1;
				t1 += x[i];
				if(l <= l1+l2){
					break;
				}
				i++;
			} else {
				l2 += y[j]*v2;
				t2 += y[j];
				j--;
				if(l <= l1+l2){
					i = j;
					break;
				}
			}
		}
		
		printf("%d\n", i);
	}
	
	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,sum=0,y=0,ans;
	double x;
	while(1){
		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 <iostream>
#include <cstdio>
#include <string>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <ctime>
using namespace std;

#define rep(i,a,n) for(int i=a; i<n; i++)
#define repr(i,a,n) for(int i=a; i>=n; i--)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 999999999

#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))

typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long int ll;

typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;

int const MOD = 1000000007;

int main() {
    int l[11]; l[0] = 0;
    int v1, v2;
    while(cin >> l[1]) {
        int sum = l[1];
        rep(i,2,11) {scanf(",%d", &l[i]); sum += l[i]; l[i] += l[i-1];}
        scanf(",%d,%d", &v1, &v2);

        double r = (double)sum / (v1 + v2);
        double dist = r * v1;
        rep(i,0,11) {
            if(dist <= l[i]) {cout << i << endl; break;}
        }
    }
    return 0;
}

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

int main()
{
  int len[10];
  int len_s = 0;
  int v[3];
  double t;
  while(scanf("%d", &len[0]) != EOF)
  {
    len_s = len[0];
    for(int i = 1; i < 10; i++)
    {
      scanf(",%d", &len[i]);
      len_s += len[i];
    }
    scanf(",%d,%d", &v[0], &v[1]);
    v[2] = v[0] + v[1];
    t = (double)len_s / (double)v[2];

    int s = 0;
    int l = 0;
    bool b = t * v[0] - (int)(t * v[0]) > 0.00001;
    while(s < (int)(t * v[0]))
    {
      s += len[l];
      l++;
    }
    cout << l + (b ? 1 : 0) << endl;
  }
  return 0;
}

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

using namespace std;

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

    while(cin>>v[0]){
        double all=v[0];
        for(int i=1; i<10; i++){
            cin >>k >>v[i];
            all += v[i];
        }
        cin>>k >>sp1 >>k >>sp2;

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

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

        cout<< k<< endl;
    }

    return 0;
}

C++: $<.map{|i|*a,b,c=i.split(?,).map(&:to_f);s=0;p a.index{|j|(s+=j)>=a.reduce(:+)*b/(b+c)}+1}

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

using namespace std;

int main(void){

	int l[10],v[2],lw;
	double x,ln;

	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){
		lw=0;
		for(int i=0;i<10;i++) lw+=l[i];
		x=(double)(lw)/(v[0]+v[1]);
		ln=v[0]*x;
		for(int i=0;i<10;i++){
			ln-=l[i];
			if(ln<=0){
				cout<<i+1<<endl;
				break;
			}
		}
	}

return 0;

}

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

using namespace std;

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

    while(cin>>v.at(0)){
        for(int i=1; i<10; i++){
            cin>> v.at(i);
        }
        cin>> sp1>> sp2;
        if(cin.eof()) break;
        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<algorithm>
#include<cstdio>
using namespace std;

int main(){

  int i;
  double x,sum,v1,v2,a[100];

  while(cin >> a[0]){

    sum = 0;

    for(i=1;i<9;i++) scanf(",%lf",&a[i]);
    scanf(",%lf,%lf,%lf",&a[9],&v1,&v2);

    for(i=0;i<10;i++) sum += a[i];
 
    x = sum/(v1+v2);

    sum = v1 * x;

    for(i=0;i<10;i++){
      if(sum - a[i] > 0) sum -= a[i];
      else{
	cout << i+1 << endl;
	break;
      }
    }

  }
}

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;

int main() {
  int l[10], v1, v2;
  while (!cin.eof()) {
    int len = 0;
    for (int i = 0; i < 10; i++) {
      cin >> l[i];
      cin.ignore();
      len += l[i];
      if (cin.eof()) return 0;
    }
    cin >> v1; cin.ignore();
    cin >> v2;
    double dist = (double)len * v1 / (v1 + v2);
    int i = 0;
    for (int s = 0; s < dist && i < 10; s += l[i], i++) {}
    cout << i << endl;
  }

  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 + v2)) * v1;

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

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

using namespace std;

int main(){
    vector<int> v(10);
    vector<int> ::iterator it;
    int sp1, sp2;
    int all=0, sp_sum;

    while(cin>>v.at(0)){
        for(it = v.begin()+1; it != v.end(); it++){
            cin>> *it;
        }
        cin>> sp1>> sp2;

        for(it = v.begin(); it != v.end(); it++){
            all += *it;
        }
        sp_sum = sp1+sp2;

        double hour = (double)all/sp_sum;
        double x = sp1*hour;

        int k = 0;
        it=v.begin();
        while(x>0){
            x -= *it;
            it++;
            k++;
        }

        cout<< k<< endl;
    }

    return 0;
}