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>

using namespace std;

int main(){
  int l[10],l_sum = 0,v1,v2;
	char d;
	double t;
	while(cin >> l[0]){
	  l_sum = l[0];
	  for(int i=1;i<10;i++){
		cin >> l[i] >> d;
		l_sum += l[i];
	  }
	  cin >> v1 >> d >> v2;

	  int l_v1 = 0,l_tmp = 0,ans=0;
	  l_v1 = (l_sum*v1) /(v1 + v2);
 
	  while(l_tmp < l_v1){
		l_tmp += l[ans];
		ans++;
	  }
	  cout << ans << endl;  
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main()
{
	int l[10], v[2], d[10], i, r;
	double L;
	char c;
	while (cin >> l[0] >> c >> l[1] >> c >> l[2] >> c >> l[3] >> c >> l[4] >> c >> l[5] >> c >> l[6] >> c >> l[7] >> c >> l[8] >> c >> l[9] >> c >> v[0] >> c >> v[1])
	{
		for (i = 1, d[0] = l[0]; i < 10; i++)
			d[i] = d[i-1] + l[i];
		L = ((double)d[9]*(-(double)v[0])) / (-(double)v[0]-(double)v[1]);
		     if (0.0 <= L && L <= d[0])	r = 1;
		else if (d[0] < L && L <= d[1])	r = 2;
		else if (d[1] < L && L <= d[2])	r = 3;
		else if (d[2] < L && L <= d[3])	r = 4;
		else if (d[3] < L && L <= d[4])	r = 5;
		else if (d[4] < L && L <= d[5])	r = 6;
		else if (d[5] < L && L <= d[6])	r = 7;
		else if (d[6] < L && L <= d[7])	r = 8;
		else if (d[7] < L && L <= d[8])	r = 9;
		else if (d[8] < L && L <= d[9])	r = 10;
		cout << r << endl;
	}
}

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

int main() {
	int l[10],v1,v2,sum;
	float x;
	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)+1){
		for(int i=1;i<10;++i){
			l[i] += l[i-1];
		}
		
		x = (float)l[9] * v1 / (v1+v2);
		for(int i=0;i<10;++i){
			if(x<=l[i]){
				cout<<i+1<<endl;
				break;
			}
		}
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
  int l[10],l_sum = 0,v1,v2;
	char d;
	double t;
	while(cin >> l[0] && l[0]){
	  l_sum = l[0];
	  for(int i=1;i<10;i++){
		cin >> l[i] >> d;
		l_sum += l[i];
	  }
	  cin >> v1 >> d >> v2;

	  int l_v1 = 0,l_tmp = 0,ans=0;
	  l_v1 = (l_sum*v1) /(v1 + v2);
 
	  while(l_tmp < l_v1){
		l_tmp += l[ans];
		ans++;
	  }
	  cout << ans << endl;  
	}
}

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

const int N = 11;

int main() {
  string s;
  while(cin >> s) {
    double d[N];
    double v1, v2;
    replace(s.begin(), s.end(), ',', ' ');
    stringstream ss(s);
    d[0] = 0;
    for(int i = 1; i < N; ++i) {
      ss >> d[i];
      d[i] += d[i-1];
    }
    ss >> v1 >> v2;
    double x = v1/(v1+v2)*d[N-1];
    cout << (lower_bound(d,d+N,x)-d) << endl;
  }
  return 0;
}

C++:  
 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 
 using namespace std;
  
 int main()
 {
   int N;
   int arr[10];
   int v1,v2;
   while(cin>>arr[0])
   {
     double sum=arr[0];
     char temp;
     cin>>temp;
     double sum2=0;
     for(int i=1;i<10;i++)
     {
       char temp_2;
       cin>>arr[i]>>temp_2;
       sum+=arr[i];
     }
     char temp_3;
     cin>>v1>>temp_3>>v2;
     int result;
     double dis=1.0*v1/(v1+v2)*sum;
     for(int i=0;i<10;i++)
     {
       sum2+=arr[i];
       if(dis<=sum2)
       { 
         result=i+1;
         break;
       }           
     }
     cout<<result<<endl;  
   }
   //while(1);     
   return 0; 
 }

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>

using namespace std;

int main() {
    string line;
    while(cin >> line) {
        for(int i = 0; i < line.size(); ++i) 
            if(line[i] == ',') line[i] = ' ';
        istringstream is(line);
        vector<int> ls(10);
        int v1, v2;
        for(int i = 0; i < 10; ++i) is >> ls[i];
        is >> v1 >> v2;
        int len = accumulate(ls.begin(), ls.end(), 0);
        int pos = v1*len/(v1+v2);
        int mod = v1*len%(v1+v2);
        int acc = 0;
        for(int i = 0; i < 10; ++i) {
            acc += ls[i];
            if(acc >= pos) {
                if(acc > pos || (acc == pos && mod == 0)) cout << i+1 << endl;
                else cout << i+2 << endl;
                break;
            }
        }
    }
    return 0;
}

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

int main()
{
	char c;
	int l[11], v1, v2;
	while (cin >> l[1]) {
		for (int i = 2; i <= 10; i++) {
			cin >> c >> l[i];
			l[i] += l[i - 1];
		}
		cin >> c >> v1 >> c >> v2;
		for (int i = 1; i <= 10; i++) {
			if (v2 * l[i - 1] <= v1 * (l[10] - l[i - 1]) && v2 * l[i] >= v1 * (l[10] - l[i])) {
				cout << i << endl;
				break;
			}
		}
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
main()
{
	int l[10],v1,v2;
	while(1){
		for(int i=0;i<10;i++)if(!~scanf("%d,",l+i))break;
		if(!~scanf("%d,%d",&v1,&v2))break;
		int s=0;
		for(int i=0;i<10;i++)s+=l[i];
		double p=v1*1.0/(v1+v2);
		double u=s*p,t=0;
		for(int i=0;i<10;i++)
		{
			t+=l[i];
			if(u<=t)
			{
				cout<<i+1<<endl;
				break;
			}
		}
	}
}

C++: #include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

vector<string> split_naive(const string &s, char delim) {
	vector<string> elems;
	string item;
	for(char ch:s){
		if(ch==delim){
			if(!item.empty()) elems.push_back(item);
			item.clear();
		}
		else{
			item += ch;
		}
	}
	if(!item.empty()) elems.push_back(item);
	return elems;
}

int main(){
	//cin.tie(0);
	//ios::sync_with_stdio(false);
	
	string S;
	while(cin>>S){
		auto SS = split_naive(S,',');
		vector<int> L(10);
		for(int i=0;i<10;i++){
			sscanf(SS[i].c_str(),"%d",&L[i]);
		}
		int V1,V2;
		sscanf(SS[10].c_str(),"%d",&V1);
		sscanf(SS[11].c_str(),"%d",&V2);

		double SL = accumulate(ALL(L),0);
		double x = (SL*V1)/(V1+V2);
		int TL = 0;
		REP(i,10){
			if(TL+L[i]>=x){
				out(i+1);
				break;
			}
			TL+=L[i];
		}
	}
	return 0;
}

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

int main(){
    int k[10];
    char g;
    while(1){
        int s=0,c=0,a,b;
        double v,p=0;
        for(int i=0;i<10;i++) cin>>k[i]>>g,p+=k[i];
        cin>>a>>g>>b;
        if(cin.eof())break;
        p/=(a+b),p*=a;
        while(p>s) s+=k[c],c++;
        cout<<c<<endl;
    }
}