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 <bits/stdc++.h>
using namespace std;

int main() {
	int l = 0 , v1, v2;
	char a;
	vector<int> L, V1, V2;
	vector<vector<int>> LL;
	while (cin >> l >> a) {
		L.push_back(l);
		for (int i = 1; i < 10; i++) {
			cin >> l >> a;
			L.push_back(l);
		}
		cin >> v1 >> a >> v2;
		LL.push_back(L); V1.push_back(v1); V2.push_back(v2);
		L.clear();
	}
	for (int i = 0; i < LL.size(); i++) {
			double t = 0, wa = 0,li;
			for (int k = 0; k < 10; k++)wa += LL[i][k];
			t = wa / (V1[i] + V2[i]);li = t*V1[i];
			for (int k = 0; k < 10; k++) {
				li -= LL[i][k]; 
				if (li <= 0) {
					cout << k + 1 << endl; break;
				}
		}
	}
	return 0;
}

C++: #include<cstdio>

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

C++: #include<iostream>
#include<iomanip>
#include<vector>
#include<queue>
#include<list>
#include<stack>
#include<algorithm>
#include<cmath>
#include<memory>
#include<array>
 
using namespace std;
 
int main()
{
  array<double, 10> l;
  double v1, v2;
  char c;
 
  while ( cin >> l[0] )
    {
      double al = l[0];
 
      for ( auto i = 1; i < 10; ++i )
        {
          cin >> c >> l[i];
          al += l[i];
        }
   
      cin >> c >> v1 >> c >> v2;
 
      double p = al * v1 / (v1 + v2);
 
      double cl = 0;
 
      for ( auto i = 0; i < 10; ++i )
        {
          cl += l[i];
          if ( cl >= p )
            {
              cout << i + 1 << endl;
              break;
            }
        }
    }
   
  return 0;
}

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

int main(){
  double l[10],v[2],time,root;

  while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&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){
    double suml=0,sumv=0;
    for(int i=0;i<10;i++){
      suml+=l[i];
    }
    sumv=v[0]+v[1];

    time=suml/sumv;

    root=v[0]*time;

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

  }

}

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

int main(){
	int k[12], v1, v2, x;
	double h, d;

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

		x = 0;
		for(int i=1 ; i<=10 ; i++){
			x += k[i];
		}
		h = (double)x/(v1+v2);
		d = (double)v1*h;
		printf("x:%d h:%.1f d:%.1f\n", x, h, d);
		x = 0;
		for(int i=1 ; i<=10 ; i++){
			x += k[i];
			if( d <= x ){
				printf("%d\n", i);
				break;
			}
		}
	}
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <functional>
#include <sstream>
#include <complex>
#include <climits>
using namespace std;

#define REP(i,a,n) for(int i=(a);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define EPS 1e-8

int gcd(int x, int y){
	return y ? gcd(y,x%y) : x;
}

int main(){
	int d[10],v1,v2;
	while(~scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",d,d+1,d+2,d+3,d+4,d+5,d+6,d+7,d+8,d+9,&v1,&v2)){
		int dis=0;
		rep(i,10)dis+=d[i];
		int j;
		//printf("dis:%d  k:%lf\n",dis,k);
		int sum = 0;
		for(j=0; j<10; j++){
			sum += d[j];
			if( sum*(v1+v2)>=dis*v1 ){
				printf("%d\n",j+1);
				break;
			}
		}
		
	}
	return 0;
}

C++: 
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }


vector<string> split(string str, string delim)
{
    vector<string> result;
    int cutAt;
    while( (cutAt = str.find_first_of(delim)) != str.npos )
    {
        if(cutAt > 0)
        {
            result.push_back(str.substr(0, cutAt));
        }
        str = str.substr(cutAt + 1);
    }
    if(str.length() > 0)
    {
        result.push_back(str);
    }
	return result;
}


int main()
{
	vint line(10);
	float v1, v2;
	string str;

	while(cin >> str)
	{
		vector<string> ss = split(str, ",");

		rep(i, 10)
		{
			line[i] = 0;
			rep(j, ss[i].size())
			{
				line[i] += pow((double)10, (double)ss[i].size() - j -1) * (ss[i][j] - '0');
			}
		}

		v1 = v2 = 0;

		rep(j, ss[10].size())
			v1 += pow((double)10, (double)ss[10].size() - j -1) * (ss[10][j] - '0');
		rep(j, ss[10].size())
			v2 += pow((double)10, (double)ss[11].size() - j -1) * (ss[11][j] - '0');


		float sum = accumulate(ALL(line), 0);

		float cross = sum / (v1 + v2) * v1;

		partial_sum(ALL(line), line.begin());

		rep(i, 10)
			if(cross <= line[i])
			{
				cout << i + 1 << endl;
				break;
			}
	}
}

C++: #include <fstream>
#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;

int main() {
  // ifstream cin("../test.txt");
  int l[10];
  int v1, v2;
  while (cin >> l[0]) {
    int L = l[0];
    char c;
    for (int i = 1; i < 10; i++) {
      cin >> c >> l[i];
      L += l[i];
    }
    cin >> c >> v1;
    cin >> c >> v2;

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

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

int main() {
	int l[10];
	int x1,x2;
	while (cin >> l[0])
	{
		int sum=0;
		for (int i=1; i<10; i++)scanf(",%d",&l[i]);
		for (int i=0; i<10; i++)sum+=l[i];
		scanf(",%d,%d",&x1,&x2);
		double time=(double)(sum)/(x1+x2);
		double d=time*x1;
		int r=0;
		while (d>0)
		{
			d-=l[r];
			r++;
		}
		cout << r << endl;
	}
	return 0;
}