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<stdio.h>
using namespace std;
int t[10],v1,v2,sum;
double x;
char ch;
int main(){
  while(cin>>t[0]){
    sum=t[0];
    scanf("%c",&ch);
    for(int i=1;i<10;i++){
      cin>>t[i];
      sum+=t[i];
      t[i]=sum;
      scanf("%c",&ch);
    }
    cin>>v1>>ch>>v2; scanf("%c",&ch);
    //v1*t+v2*t==sum;
    //t*(v1+v2)==sum;
    //t==sum/(v1+v2);
    //v1*t==v1*(sum/(v1+v2));
    x=v1*((double)sum/(v1+v2));
    //cout<<x<<endl;
    for(int i=0;i<10;i++){
      //cout<<t[i]<<endl;
      if(x<=t[i]){cout<<i+1<<endl;break;}
    }
  }
  return 0;
}

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


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

C++: #include <iostream>
#include <stdio.h>
using namespace std;
int main() {
  int b[10],i,v1,v2;
  double k[10],h;
  while (cin >> b[0] >> b[1] >> b[2] >> b[3] >> b[4] >> b[5] >> b[6] >> b[7] >> b[8] >> b[9] >> v1 >> v2) {
    k[0]=b[0];
	for (i=1;i<10;i++) k[i]=k[i-1]+b[i];
	h=v1*k[9]/(v1+v2);
	for (i=0;i<10;i++) if (h>=k[i]-b[i] && h<=k[i]) break;
	cout << i+1 << endl;
  }
  return 0;
  }

C++: #include <stdio.h>

int main(){
double v1,v2,t,x,x2;
int a[10],i;
while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%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){
x=0;
x2=0;
for(i=0;i<10;i++){
x+=a[i];
}
t=(double)x/((double)v1+(double)v2)*(double)v1;
for(i=0;i<10;i++){
x2+=a[i];
if(x2>=t){
printf("%d\n",i+1);
break;
}
}
}
return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <set>

using namespace std;
typedef long long LL;
static const double EPS = 1e-9;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n) 

int l[10],L[11],v[2];
int main(void){
  while(cin>>l[0]){
    getchar();
    for(int i=1; i<10; i++){
      cin >> l[i];
      getchar();
    }
    cin >> v[0];
    getchar();
    cin >> v[1];
    L[0] = 0;
    for(int i=1;i<=10; i++)
      L[i] = L[i-1] + l[i-1];
    double con = (double)v[0]/(v[0]+v[1]) * L[10];
    for(int i=0;i<10;i++){
      if(con==0) cout << 1 << endl;
      if(i==9) cout << 10 << endl;
      if(L[i] < con && con <= L[i+1]){
        cout << (i+1) << endl;
        break;
      }
    }
  }
  return 0;
}

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

int main(void)
{
    int cost[10];
    int cost_sum;
    int v1, v2;
    int ans_place;
    
    
    while (scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &cost[0], &cost[1], &cost[2], &cost[3], &cost[4], &cost[5], &cost[6], &cost[7], &cost[8], &cost[9], &v1, &v2) != EOF){
        cost_sum = ans_place = 0;
        
        for (int i = 0; i < 10; i++){
            cost_sum += cost[i];
        }
        
        double tmp = (double)cost_sum / (double)(v1 + v2);
        
        cost_sum = 0;
        
        while (cost_sum < (tmp * v1)){
            cost_sum += cost[ans_place];
            ans_place++;
        }
        
        printf("%d\n", ans_place);
    }
    
    return (0);
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int l[10],v1,v2;
  int result,ans;
  double total, time, distance;

  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) != EOF){

    total=0;
    for(int i=0; i<10; i++)
      total += l[i];
    time = (double)total/(v1+v2);
    distance = v1 * time;
    result = 0;
    for(ans=0; result < distance; ans++)
      result += l[ans];
    cout << ans << endl;
  }
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(){
  int l[11];
  int a,b;
  int i;
  int count=0;
  double test=0;
  double ans=0,ans1=0;
  for(i=1;i<=10;i++){
    scanf("%d,",&l[i]);
    ans+=l[i];
  }
  scanf("%d,%d",&a,&b);
  ans1=a+b;
  ans=ans/ans1;
  ans=ans*a;
  for(i=1;i<=10;i++){
    test+=l[i];
    count++;
    if(test>=ans)break;
  }
  cout << count << endl;
}

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;
*/
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;

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>

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;
	  l_v1 = (l_sum*v1) /(v1 + v2);
	  for(int i=0;i<10;i++){
		if(l_tmp >= l_v1){
		  cout << i << endl;
		  break;
		}
		else l_tmp += l[i];
	  }
	}
	return 0;
}

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

int main()
{
	int lengthes[10];
	char tmp;
	while (std::cin >> lengthes[0] >> tmp >> lengthes[1] >> tmp >> lengthes[2] >> tmp >> lengthes[3] >> tmp >> lengthes[4] >> tmp >> lengthes[5] >> tmp >> lengthes[6] >> tmp >> lengthes[7] >> tmp >> lengthes[8] >> tmp >> lengthes[9] >> tmp )
	{
		int v1, v2;
		std::cin >> v1 >> tmp >> v2;

		int sum = std::accumulate(&lengthes[0], &lengthes[10], 0);

		double sec = (double)(sum) / (v1 + v2);
		double dist = v1 * sec;

		int all = 0;
		int index = 1;
		for (auto length : lengthes)
		{
			all += length;
			if (dist <= all)
			{
				std::cout << index << std::endl;
				break;
			}
			index++;
		}
	}

	return 0;
}

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

double eps = 1e-10;

class Point {
public:
	double x, y;
	
	Point(double x = 0, double y = 0) : x(x), y(y) {}
	
	Point operator + (const Point& p) {
		return Point(x + p.x, y + p.y);
	}
	Point operator - (const Point& p) {
		return Point(x - p.x, y - p.y);
	}
	Point operator * (const double& a) {
		return Point(x * a, y * a);
	}
	Point operator / (const double& a) {
		return Point(x / a, y / a);
	}
	
	bool operator < (const Point& p) const {
		return x != p.x ? x < p.x : y < p.y;
	}
	bool operator == (const Point& p) const {
		return fabs(x - p.x) < eps && fabs(y - p.y) < eps;
	}
	
	double abs() {
		return sqrt(norm());
	}
	double norm() {
		return x * x + y * y;
	}
	
};

class Circle {
public:
	Point c;
	double r;
	Circle(Point c = Point(), double r = 0.0) : c(c), r(r) {}
};

int main() {
	int d[16] = {0}, sum[16] = {0}, 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){
		for(int i = 1; i <= 10; ++i)
			sum[i] = sum[i - 1] + d[i - 1];
		
		double t = (double)sum[10] / (double)(v1 + v2);
		double dv = t * v1;
		for(int i = 1; i <= 10; ++i){
			if(sum[i] >= dv){
				cout << i << endl;
				break;
			}
		}
	}
	return 0;
}