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 <cstdio>

double l[10],v1,v2;

int main(){
  while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",l,l+1,l+2,l+3,l+4,l+5,l+6,l+7,l+8,l+9,&v1,&v2)){
    double p=0;
    for(int i=0; i<10; i++) p+=l[i];
    p=p*v1/(v1+v2);
    for(int i=0; i<10; i++){
      if(p>l[i]) p-=l[i];
      else{
	printf("%d\n",i+1);
	break;
      }
    }
  }
}

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

using namespace std;

int main() {

  int l[10], v[2];
  double total, point, now;

  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], &v[0], &v[1]) + 1) {

    total = 0;
    now = 0;

    for(int i = 0; i < 10; ++i) total += l[i];

    point = total * v[0] / (v[0] + v[1]);
    
    for(int i = 0; i < 10; ++i) {
      now += l[i];
      if(now >= point) {
	cout << i + 1 << endl;
	break;
      }
    }

    //cout << total << " " <<  point << 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",&num[0])!=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() {
	double l[10];
	double v[2];
	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]) {
		double a = 0;
		for (int i = 0; i < 10; i++){
			a += l[i];
		}
		a = a * v[0] / (v[0] + v[1]);
		for (int i = 0; i < 10; i++){
			a -= l[i];
			if (a == 0){
				cout << i << endl;
			}else
			if (a < 0){
				cout << i + 1 << endl;
				goto c;
			}
		}
	c:
		a = 0;
	}
}

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

int main() {
	int a[10];
	int b, c;
	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],&b,&c)+1) {
		int dis=0;
		for (int i = 0; i < 10; i++) {
			dis += a[i];
		}
		double disa;
		disa = static_cast<double>(dis);
		int speed = b + c;
		double x = disa / speed * b;
		int j = 0;
		while (1) {
			if (x - a[j] < 0) { break; }
			x -= a[j];
			j++;
		}
		cout << j + 1 << endl;
	}
	return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

int main() {
	int v1,v2,sum,ret;
	vector<int> l(10, 0);
	scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n", &l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&l[10],&v1,&v2);
	sum = (l[1]+l[2]+l[3]+l[4]+l[5]+l[6]+l[7]+l[8]+l[9]+l[10])*(int)(v1/(v1+v2));
	for (int i=0; i<10; i++) {
		sum -= l[i];
		if (sum <= 0) {
			ret = i;
			break;
		}
	}
	cout << ret << endl;
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<vector>
#include<utility>
#include<queue>
#include<math.h>
#include<string>
#include<stack>
#include<typeinfo>
using namespace std;
typedef pair<int, int> P;
int main() {
	// x/u=(l-x)/v
	//ul-ux=xv
	//xv+ux=ul
	//x=ul/(v+u)//x=1から見た長さu=1からくる電車の速度
	int  l[10];
	vector<int>rui(11,0);
	double v1, v2, sum,x;
	char ch;
	while (cin>>l[0]>>ch) {
		sum = 0;
		sum += l[0];
		rui[1] = l[0];
		for (int i = 1; i < 10; ++i) {
			cin >> l[i] >> ch;
			sum += l[i];
			rui[i + 1] = l[i] + rui[i];
		}
		cin >> v1 >> ch >> v2;
		x = v1*sum / (v2 + v1);
		for (int i = 1; i <= 10; ++i) {
			if (rui[i - 1] < x&&x < rui[i] || x == rui[i]) {
				cout << i << endl;
				break;
			}
		}
	}
	return 0;
}

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

int main() {
	int length[10];
	int v1,v2;
	float res;
	while ( scanf("%d",&length[0] ) != -1) {
		for ( int i = 1; i < 10; i++ ) {
			scanf(",%d",&length[i] );
		}
		scanf(",%d,%d", &v1, &v2);
		
		int sum = 0;
		for ( int i = 0; i < 10; i++ )
			sum = sum + length[i];
		res = (float)sum / (1+(float)v2/(float)v1) ;
		cout << res << " ";
		for ( int i = 0; i < 10; i++ ){
			if ( res - length[i] > 0 ) {
				res = res - length[i];
			} else {
				cout << i+1 << endl;
				break;
			}
		}
	}
}

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

#define iota(i,n,b,s) for(int i=int(b);i!=int((b)+(s)*(n));i+=(s))
#define range(i,n,m) iota(i,(((n)>(m))?((n)-(m)):((m)-(n))),(n),((n)>(m)?-1:1))
#define rep(i,n) iota(i,(n),0,1)
#define loop for(;;)

#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (a.first)
#define cdr(a) (a.second)
#define cadr(a) (car(cdr(a)))
#define cddr(a) (cdr(cdr(a)))
#define all(a) a.begin(), a.end()
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;

typedef long long Integer;
typedef double Real;
typedef vector<int> vi;
typedef vector<string> vs;
typedef map<string,int> Dictionary;
const Real PI = acos(-1);

template<class S, class T>
ostream& operator<<(ostream& os, pair<S,T> p) {
  os << '(' << car(p) << ", " << cdr(p) << ')';
  return os;
}

template<class T>
ostream& operator<<(ostream& os, vector<T> v) {
  if (v.size() == 0) {
    os << "(empty)";
    return os;
  }
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

int dx[] = { -1, 0, 1, 0 };
int dy[] = {  0, -1, 0, 1 };

bool
f(vector<int>&ln, int idx, int x, int y) {
  if (idx == 10) return true;
  int z = ln[idx];
  return (x < z && f(ln, idx + 1, z, y)) || (y < z && f(ln, idx + 1, x, z));
}

int main() {

  loop {
    vector<int>ls(10);
    char com;
    int v1, v2;

    int len = 0;
    rep(i, 10) {
      cin >> ls[i] >> com;
      len += ls[i];
    }
    if (!cin) break;

    cin >> v1 >> com >> v2;
    int V = v1 + v2;

    rep (i, 10) {
      ls[i] *= V;
    }

    int le1 = len * v1;
    for (int i=0; i<10; ++i) {
      le1 -= ls[i];
      if (le1 <= 0) {
        cout << -~i << endl;
        break;
      }
    }

  }

  return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cmath>
#include <string>
#include <map>
#include <utility>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>

#include <cstdio>

using namespace std;

int main()
{
	int l[10], v[2];
	while (scanf("%d", &l[0]) != EOF)
	{
		vector<double> a;
		a.push_back(0);
		a.push_back(l[0]);
		for (int i = 1; i < 10; i++)
		{
			scanf(",%d", &l[i]);
			a.push_back(a.back() + l[i]);
		}
		scanf(",%d,%d", &v[0], &v[1]);
		double w = a.back() / (v[0] + v[1]);
		w *= v[0];
		for (int i = 1; i < a.size(); i++)
		{
			if (a[i] == w)
			{
				cout << i  << endl;
				break;
			}
			if (a[i]>w&&a[i - 1] < w)
			{
				cout << i << endl;
				break;
			}
		}

	}


}