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 <vector>
#include <list>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <sstream>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#define rep(i, n) for(int i = 0; i < n; i ++)
#define ITER(c) __typeof((c).begin())
#define each(c, it) for(ITER(c) it =(c).begin(); it!=(c).end(); it++)
#define ALL(c) c.begin(), c.end()
#define mp make_pair
#define pb push_back
#define MEMSET(v, h) memset((v), h, sizeof(v))
 
using namespace std; 

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;

const int INF = 1 << 24;
const int N = 10;

int main(void){
    for(;;){
        vi l(N), v(2);
        double dis = 0; char c;
        rep(i, N){ if(i) cin >> c; if(!(cin >> l[i])) return 0; dis += l[i]; }
        rep(i, 2) cin >> c >> v[i];

        dis = v[0] * dis / (v[0] + v[1]);

        int res = 0; double cur = 0;
        rep(i, N){
            cur += l[i];
            if(dis <= cur){ res = i + 1; break; }
        }
        cout << res << endl;
    }
 
    return 0;
}

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

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

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(){
	int d[10],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){
		int sum=0,table[11];
		for(int i=0;i<10;++i){
			table[i]=sum;
			sum+=d[i];
		}
		table[10]=sum;
		for(int i=10;i>=0;--i){
			if(table[i]<(double)(v1*sum)/(v1+v2)){
				cout<<i+1<<"\n";
				break;
			}
		}
	}
	return 0;
}

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

int f(void){
	int x[10], v1=0, v2=0, tmp=0;
	char c;
	for (int i=0; i<10;i++){
		cin>>x[i]>>c;
		tmp += x[i];
	}
	cin>>v1>>c>>v2;

	double r=1.0*tmp*v1/(v1+v2);
	tmp = 0;
	for (int i=0; i<10; i++){
		tmp += x[i];
		if (tmp>=r) return i+1;
	}
}

int main(void){
	while (!cin.eof())
		cout<<f()<<endl;
	return 0;
}

C++: #include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) loop(i,0,b)
using namespace std;
int main(){
  int in[10];
  int p;
  while(cin>>p){
    in[0]=p*100;
    int a,b;
    int suma=0,sumb;
    char d;
    cin>>d;
    int sum=in[0];
    loop(i,1,10){
      int tmp;
      cin>>tmp;
      in[i]=tmp*100;
      sum+=in[i];
      cin>>d;
    }
    cin>>a>>d>>b;
    sumb=sum;
    int i;
    cout<<suma<<" "<<sumb<<endl;
    for(i=0;sumb>suma;i++){
      suma+=in[i];
      sumb-=(((double)in[i]/a)*b);
      //cout<<suma<<" "<<sumb<<endl;
    }
    cout<<i<<endl;
  }
}

C++: #include<iostream>

using namespace std;

int data[11];
int sum=0;
bool input(){
	fill(data,data+11,0);
	char c;
	int x;
	for(int i=1;i<=10;i++){
		cin>>x;
		cin>>c;
		data[i]=data[i-1]+x;
	}
	return true;
}
int main(){
	while(input()){
		int v1,v2;
		char c;
		cin>>v1>>c>>v2;
		double t=1.*data[10]/(v1+v2);
		
		for(int i=1;i<=10;i++){
			if(v1*t<=data[i]){
				cout<<i<<endl;
				break;
			}
		}
	}
}

C++: #include <iostream>
#define  rep(i,n) for(int i = 0 ; i < n ; i++ )
using namespace std;

int main(){
  double v1,v2;
  int l[10];
  double sum = 0;
  rep(i,10){
    scanf("%d,",&l[i]);
    sum += l[i];
  }
  scanf("%lf,%lf",&v1,&v2);
  double sum2 = 0;
  v1=(v1/(v1+v2))*sum;
  rep(i,10){
    sum2+=l[i];
    if(v1 <= sum2){
      cout << i+1 << endl;
      break;
    }
  }
  return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
#define int ll

vector<string> split(const string &str, char sep)
{
  vector<string> v;
  auto first = str.begin();
  while( first != str.end() ) {
    auto last = first;
    while( last != str.end() && *last != sep ) ++last;
    v.push_back(std::string(first, last));
    if( last != str.end() ) ++last;
    first = last;
  }
  return v;
}

signed main(void)
{
  string s;
  while(cin >> s) {
    vector<string> v = split(s, ',');
    int l1[11] = {0}, l2[11] = {0}, v1, v2;
    REP(i, v.size()) {
      if(i<10) {
        l1[i+1] = stoi(v[i]);
        l2[i] = l1[i+1];
      }
      else if(i == 10) v1 = stoi(v[i]);
      else if(i == 11) v2 = stoi(v[i]);
    }
    FOR(i, 1, 11) l1[i] += l1[i-1];
    for(int i=8; i>=0; --i) l2[i] += l2[i+1];
    double t1[11], t2[11];
    REP(i, 11) {
      t1[i] = (double)l1[i]/v1;
      t2[i] = (double)l2[i]/v2;
    }
    //REP(i, 11) cout << t1[i] << " "; cout << endl;
    //REP(i, 11) cout << t2[i] << " "; cout << endl;
    REP(i, 10) {
      if((t1[i] < t2[i] && t2[i] <= t1[i+1]) ||
      (t1[i] < t2[i+1] && t2[i+1] <= t1[i+1])) {
        cout << i+1 << endl;
        break;
      }
    }
  }

  return 0;
}

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

int main(){
	int l[10],va,vb,v,tl;
	double a,tv;
	char ch;
	while(1){
		tl = 0;
		for(int i = 0;i < 10;++i){
			cin >> l[i];
			if(cin.eof()) break;
			cin >> ch;
			tl += l[i];
		}
		if(cin.eof()) break;
		cin >> va >> ch >> vb;
		v = va + vb;
		a = (double)tl / (double)v;
		tv = (double)va;
		tv *= a;
		for(int i = 0;i < 10;++i){
			tv -= (double)l[i];
			if(tv <= 0.0) {
				cout << i + 1 << endl;
				break;
			}
		}

	}
	return 0;
}

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

const double EPS = 1.0e-6;
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) > 0){
		int suml = 0;
		for(int i=0; i<10; i++){
			suml += l[i];
		}
		double time = 1.0*suml / (v1+v2);
		double miti = time*v1 - EPS;
		int ans = 0;
		for(int i=0, sl=0; i<10; i++){
			if(miti < sl){
				ans = i;
				break;
			}
			sl += l[i];
		}
		cout<<ans<<endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
    int v1, v2;
    double d, time;
    int l[10];
    char comma;

    while (cin >> l[0] >> comma) {
        int tmp;
        d = l[0];

        for (int i = 1; i < 10; i++) {
            cin >> tmp >> comma;
            d += tmp;
            l[i] = l[i - 1] + tmp;
        }

        cin >> v1 >> comma >> v2;

        time = v1 * d / (v1 + v2);

        for (int i = 0; i < 9; i++)
            if (l[i] < time && time <= l[i + 1]) {
                cout << i + 2 << endl;
                break;
            }
    }

    return 0;
}