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(void){
  double l[10];
  double v1, v2;
  char c;
  while(!cin.eof()){
    double ls = 0;
    for(int i = 0; i < 10; i++){
      cin >> l[i] >> c;
      ls += l[i];
    }
    cin >> v1 >> c >> v2;
    
    double t = ls / (v1 + v2);
    double x = v1 * t;

    double y = 0.0;
    int cnt = 0;

    while(y < x){
      y += l[cnt];
      cnt++;
    }
    cout << cnt << endl;
  }
  return 0;
}

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

int main(){
	int dis[10], v_0 = 0,v_1 = 0;
	while( scanf("%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d",&dis[0],&dis[1],&dis[2],&dis[3],&dis[4],&dis[5],&dis[6],&dis[7],&dis[8],&dis[9],&v_0,&v_1)==12){
		int dsum = 0;
		double acum[10];
		for(int x=0;x<10;++x){
			dsum += dis[x];
			acum[x] = 1.0*dsum;
		}		
		double dd = v_0 * (dsum*1.0/(v_0+v_1));
		//cout<<dd<<endl;
		int index = 0;
		while(index<10 && acum[index]<dd){
			++index;
		}
		--index;
		if(acum[index]==dd)cout<<index+1<<endl;
		else cout<<index+2<<endl;
	}
	return 0;
}

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

int main()
{

int num[11]={};
int x,t,T=0;
double S1=0,S2=0,V1,V2,W;
bool f1=false,f2=false;
while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%lf,%lf",&num[0],&num[1],&num[2],&num[3],&num[4],&num[5],&num[6],&num[7],&num[8],&num[9],&V1,&V2)!=EOF){
/*
for(int i=1;i<10;i++)
{scanf("%d",&x);num[i]=x;}
cin>>V1>>V2;
*/W=0;S1=0;S2=0;
for(int i=0;i<10;i++)
S1+=num[i];
for(int i=0;i<10;i++)
S2=V1+V2;
t=0;
W=S1*V1/S2;
cout<<S1<<" "<<S2<<" "<<W;
do{

T+=num[t];
if(T==W)f1=true;
t++;
}while(T<W);
if(f1==false)printf("%d\n",t);
else if(f1==true)printf("%d\n",t);
}
return 0;
}

C++: #include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
#include <cmath>
using namespace std;

#define rep(i,n) for(int i=0;i<int(n);++i)

int l[10];
int v1,v2;
char t;
int len;
double tim;
double L;

int main(){
	while(cin>>l[0]){
		rep(i,9){
			cin>>t>>l[i+1];
		}
		cin>>t>>v1>>t>>v2;
		v2+=v1;
		len = 0;
		rep(i,10) len+=l[i];
		tim = (double)len / v2;
		L = v1*tim;
		rep(i,10){
			if(L<=l[i]){
				l[0] = i;
				break;
			}
			else{
				L-=l[i];
			}
		}
		cout<<l[0]+1<<endl;
	}
	return 0;
}

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

using namespace std;
int main(void)
{
	double a[10];
	double v[2];
	double ans;
	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],&v[0],&v[1]) != EOF)
	{
		double all = 0;
		double kari = 0;
		for(int i = 0;i < 10;i++) all += a[i];
		ans = (v[0] * all) / (v[0] + v[1]);
		if(ans == 0) printf("1\n");
		else
		{
			for(int i = 0;i < 10;i++)
			{
				kari += a[i];
				if(kari >= ans)
				{
					printf("%d\n",i+1);
					break;
				}
			}
		}
	}
	return 0;
}

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

int main() {
	double v1,v2,x=0;
	int p,s[10];
	while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%lf,%lf",
			&s[0],&s[1],&s[2],&s[3],&s[4],&s[5],&s[6],&s[7],&s[8],&s[9],&v1,&v2)+1){
		double x=0,temp=0;
		for(int i=0;i<10;i++) x+=s[i];
		v1/=(v1+v2); x*=v1;
		for(p=0;x>temp;p++) temp+=s[p];
		cout<<p<<endl;
	} return 0;
}

C++: #include <cstdio>
#include <iostream>
using namespace std;
int main() {
	int l[10];
	double v1, v2;
	while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%lf,%lf", &l[0], &l[1], &l[2], &l[3], &l[4], &l[5], &l[6], &l[7], &l[8], &l[9], &v1, &v2) != EOF) {
		double d = 0, g;
		for(int i = 0; i < 10; ++i) {
			d += l[i];
		}
		g = d * v1 / (v1 + v2);
		int s = 0, sum = 1;
		for(int i = 0; i < 10; ++i, ++sum) {
			s += l[i];
			if(s >= g) {
				cout << sum << endl;
				break;
			}
		}
	}
}

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


int main(){
		
	int km[10],v1,v2,n; char a;
	double length; int leng;
	while(1){
	if(cin.eof()) break;
	for(int i=0;i<10;i++)
	cin >> km[i] >> a;
	cin >> v1 >> a >> v2;	
	leng = 0;
	for(int k =0;k<10;k++)
	leng = leng + km[k];
	length = (double)leng * ((double)v1 / ((double)v1 + (double)v2)); 
	leng = 0;
	for(int k=0;k<10;k++){
	leng = leng + km[k];
	if(leng >= length ){
	cout << k+1 <<endl; break;
	}
	}	
	}
}

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;
    while(s <= t * v[0])
    {
      s += len[l];
      l++;
      }
    cout << l  << endl;
  }
  return 0;
}

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

using namespace std;
using ll = long long;
using pii = pair<int, int>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  int l[10], v1, v2;
  char c;
  while (cin >> l[0]) {
    int sum = l[0];
    for (int i = 1; i < 10; i++) {
      cin >> c >> l[i];
      sum += l[i];
    }
    cin >> c >> v1 >> c >> v2;
    double t = 1. * sum / (v1 + v2), a = t * v1, last = 0;
    for (int i = 0; i < 10; i++) {
      if (last < a && a <= last + l[i]) {
        cout << i + 1 << endl;
        break;
      }
      last += l[i];
    }
  }

  return 0;
}

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

using namespace std;

int main(int argc, char *argv[]) {
  double d[10], v1, v2;
  vector<int> result;
  while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,\n",
               d, d+1, d+2, d+3, d+4, d+5, d+6, d+7, d+8, d+9, &v1, &v2) != EOF) {
    double hoge = 0;
    for (int i = 0; i < 10; i++)
      hoge += d[i];
    hoge /= v1 + v2;
    hoge *= v1;
    for (int i = 0; i < 10; i++) {
      hoge -= d[i];
      if (hoge <= 0) {
        result.push_back(i+1);
        break;
      }
    }
  }

  for (int i = 0; i < result.size(); i++)
    cout << result[i] << endl;
  return 0;
}

C++: #include <stdio.h>

int
main(void)
{
	char line[80];

	int l[10], v[2];

	while (true) {
		if (fgets(line, sizeof line, stdin) == NULL) {
			break;
		}
		if (sscanf(line, "%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])) != 12) {
			break;
		}

		int total = 0;
		for (int k : l) {
			total += k;
		}
		
		double h = (double)(v[0]) / (v[0] + v[1]);
		
		double p = total * h;
		
		for (int i = 0; i < 10; i++) {
			p -= l[i];
			if (p <= 0) {
				printf("%d\n", i+1);
				break;
			}
		}
	}

	return 0;
}