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 <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <numeric>
#include <iomanip>
#define fi first
#define se second
#define fcout(n) cout<<fixed<<setprecision((n))
#define cinl(str) getline(cin,(str))
using namespace std;
bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;}
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
double pie=acos(-1);
int INF=10000009;
int dx[4] = { 0,-1,0,1 };
int dy[4] = { -1,0,1,0 };
int main() {
	double l[15],v[5],d=0.0;
	char c[15];
	double x=0.0,y;
	int ans;
	while(true){
		cin>>l[0]>>c[0]>>l[1]>>c[1]>>l[2]>>c[2]>>l[3];
		cin>>c[3]>>l[4]>>c[4]>>l[5]>>c[5]>>l[6]>>c[6];
		cin>>l[7]>>c[7]>>l[8]>>c[8]>>l[9]>>c[9]>>v[0];
		cin>>c[10]>>v[1];
		if (cin.eof())break;
		for(int i=0;i<=9;i++){
			x+=l[i];
		}
		double t;
		t=x/(v[0]+v[1]);
		y=v[0]*t;
		for(int i=0;i<=9;i++){
			d+=l[i];
			if(y<=d){
				ans=i+1;
				break;
			}
		}
		cout<<ans<<endl;
	}
}

C++: #include <stdio.h>
#include <math.h>
#include <algorithm>

using namespace std;

int main(){
	double a[10],v1,v2,sum_length,distance;

	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%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){
		sum_length = 0;
		for(int i=0; i < 10; i++){
			sum_length += a[i];
		}
		distance = v1*((sum_length)/(v1+v2));

		if(distance == 0){
			printf("1\n");
		}else{
			sum_length = 0;
			for(int i=0;i<10;i++){
				sum_length += a[i];
				if(distance <= sum_length){
					printf("%d\n",i+1);
					break;
				}
			}
		}
	}

    return 0;
}

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

int l[10],v,v2;

int main(){
	while(true){
		for(int i=0;i<10;i++){
			if(scanf("%d,",&l[i])==EOF)return 0;
		}
		if(scanf("%d,%d",&v,&v2)==EOF)return 0;

		double k=(double)std::accumulate(l,l+10,0)/(v+v2)*v;

		std::cout<<k<<std::endl;

		int sum=0;
		for(int i=0;i<10;i++){
			sum+=l[i];
			if(sum>=k){
				std::cout<<i+1<<std::endl;
				break;
			}
		}
	}

	return 0;
}

C++: #include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; ++i)
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define P pair<int, int>
const int N = 10;

int v[N], a, b;

int solve(){
  double d = 0, sum = 0;
  REP(i, N) sum += v[i];
  REP(i, N - 1){
    double st = d / a, et = (d + v[i]) / a, _sb = sum - b * st, _eb = sum - b * et;
    double sb = min(_sb, _eb), eb = max(_sb, _eb);
    //cout <<i + 1 <<" | " <<st <<", " <<et <<" | " <<d <<", " <<d + v[i] <<", " <<sb <<", " <<eb <<endl;
    if((eb >= d && eb <= d + v[i]) || (sb >= d && sb <= d + v[i])) return i + 1;
    d += v[i];
  }
  return 10;
}

int main() {
  while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &v[0], &v[1], &v[2], &v[3], &v[4], &v[5], &v[6], &v[7], &v[8], &v[9], &a, &b) != EOF) cout <<solve() <<endl;
  return 0;
}

C++: #include <iostream>
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>
//#include <vector>
using namespace std;

int main(){
	int length[11] = {0};
	int v1, v2;
	while( ~scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &length[1], &length[2], &length[3], &length[4], &length[5], &length[6], &length[7], &length[8], &length[9], &length[10], &v1, &v2) ){
		for(int i=1; i<=10; i++) length[i] += length[i-1];
		double t = (double)length[10] / (v1+v2);
		for(int i=0; i<=10; i++){
			if( t*v1 <= length[i] ){
				cout << i << endl;
				break;
			}
		}
	}
}

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

int main() {

  long long int in, v0, v1;
  char c;
  while( cin >> in >> c ) {
    long long int d[10];
    d[0] = in;
    for ( int i = 1; i < 10; i++ ) {
      cin >> in >> c;
      d[i] = d[i-1] + in;
    }
    cin >> v0 >> c >> v1;
    double f = 1.00 * v0 * d[9] / ( v0 + v1 );
    for ( int i = 0; i < 10; i++ ) {
      if ( f <= d[i] ) {
	cout << i + 1 << endl;
	break;
      }
    }
  }

  return 0;

}

C++: #include<iostream>
using namespace std;
int main(){
		
	int km[10],v1,v2; char a;
&#160; &#160; double leng;
	while(1){
	 &#160; for(int i = 0; i < 10; i++)
&#160; &#160; &#160; &#160; {
&#160; &#160; &#160; &#160; &#160; &#160; cin >> km[i] >> a;
&#160; &#160; &#160; &#160; }
&#160; &#160; &#160; &#160; if(!cin)
&#160; &#160; &#160; &#160; &#160; &#160; break;
&#160; &#160; &#160; &#160; cin >> v1 >> a >> v2;
&#160;
	leng = 0.0;
	for(int k =0;k<10;k++)
	leng += km[k];&#160;
	double length = leng * v1 / (v1 +v2);&#160;
	leng = 0.0; &#160;
	for(int k=0;k<10;k++){
	leng += &#160;km[k];
	if(leng >= length ){
	
	cout << k+1 <<endl; break;
	}
	}	
	}
}

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

int main() {
  int l[11];
  char c;
  while (1) {
    for ( int i = 1; i < 11; i++ ) {
      cin >> l[i] >> c;
      if ( cin.eof() ) return 0;
    }
    int v1,v2;
    cin >> v1 >> c >> v2;

    double sum = 0;
    for ( int i = 1; i < 11; i++ ) {
      sum += l[i];
    }
    double f = 0,b = 0;
    int pos;
    for ( int i = 1; i < 11; i++ ) {
      f += l[i];
      b += l[i]*(1.0*v2/v1);
      if ( f + b >= sum ) {
	pos = i;
	break;
      }
    }
    cout << pos << endl;
  }

  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
using namespace std;
int a[10],v[2],all;
int main(){
while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],&a[9],&v[0],&v[1])!=EOF){
    all=0;
    int v2=v[0]+v[1];
    for(int i=0;i<10;i++){
        all+=a[i];
    }
    double dis=(double)all*v[0]/v2;
    for(int i=0;i<10;i++){
        dis-=a[i];
        if(dis<=0){
            cout<<i+1<<endl;
            break;
        }
    }
}
return 0;
}

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

int main(){
	int first;
	while(std::cin>>first){
		std::vector<int> distance(10);
		distance[0]=first;
		int sum=0;
		char dummy;
		sum+=first;
		for(int i=1;i<10;++i){
			std::cin>>dummy;
			int s;
			std::cin>>s;
			sum+=s;
			a+=s;
			distance[i]=a;
		}
		double v1,v2;
		std::cin>>dummy>>v1>>dummy>>v2;
		int ans=0;
		for(int i=0;i<10;++i){
			if(distance[i]<=sum/(v1+v2)*v1){
				ans=i+1;
			}
		}
		std::cout<<ans<<std::endl;
	}
	return 0;
}