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>
using namespace std;

int main()
{
	int area[10] = {0};
	
	while (scanf("%d", area) != EOF){
		int i;
		int n;
		int v[2];
		int min = *area;
		int sum = *area;
		int current[2];
		int point;
		
		for (i = 1; i < 10; i++){
			scanf(",%d", area + i);
			sum += area[i];
			if (min > area[i]) min = area[i];
		}
		scanf(",%d,%d", v, v + 1);
		for (n = 1; sum * n % (v[0] + v[1]) != 0; n++);
		sum *= n;
		
		for (current[0] = 0, current[1] = sum; current[0] < current[1];){
			current[0] += v[0];
			current[1] -= v[1];
		}
		for (i = point = 0; point < current[0]; i++) point += area[i] * n;
		printf("%d\n", i);
	}
	
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;
int main(){
	int l[10],v1,v2;
	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){
		int length=0;
		for(int i=0;i<10;i++){
			length += l[i];
		}
		double x=v1*length/(double)(v1+v2);
		int sum=l[0];
		for(int j=1;j<10;j++){
			if(sum>=x){
				cout<<j<<endl;
				break;
			}
			sum += l[j];
		}
	}
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <cstdio>
#include <math.h>
using namespace std;
int main(){
	int l[10],v1,v2;
	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){
		int length=0;
		for(int i=0;i<10;i++){
			length += l[i];
		}
		double x=v1*length/(double)(v1+v2);
		int sum=l[0];
		for(int j=1;j<10;j++){
			if(sum>=x){
				cout<<j<<endl;
				break;
			}
			sum += l[j];
		}
	}
	return 0;
}

C++: #include<stdio.h>
#include <string.h>

int main(){
	int num[10],i,x[100000],j=0;
	double ans,spd[2],sum;
	while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&num[0],&num[1]
		        ,&num[2],&num[3],&num[4],&num[5],&num[6],&num[7],&num[8]
		        ,&num[9],&spd[0],&spd[1])!=EOF)
	{
		sum=0;
		for(i=0;i<10;i++)sum+=num[i];
		ans=(spd[0] * spd[1]) / (spd[0] + spd[1]) * sum / spd[1];
	
		i=0;
		while(ans>0){
			ans-=num[i];
			++i;
		}
		x[j]=i;
		j++;
	}
	
	for(i=0;i<j;i++)printf("%d\n",x[i]);
	
return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;

#define all(c) (c).begin(), (c).end()
#define pb push_back
#define mp make_pair
#define EXIST(v,i) (find(all(v), i) != (v).end())
#define ERASE(v,i) (v).erase(remove(all(v), i), (v).end())
#define INDEX(v,i) (find(all(v), i) - (v).begin())
#define rep(i,n) for(int i = 0; i < (int)n; ++i)
#define debug(x) cerr << #x << " = " << (x) << endl;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

const int INF = 100000000;
const double PI = 3.14159265358979323846;
const double EPS = 1e-10;

int main() {
	vector<int> line(10);
	int va, vb;
	while(~scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &line[0], &line[1], &line[2], &line[3], &line[4], &line[5], &line[6], &line[7], &line[8], &line[9], &va, &vb)) {
		int linesum = accumulate(all(line), 0);
		double dist = linesum * ((double)va / (va + vb));
		vector<int> ls(10);
		ls[0] = line[0];
		for(int i = 1; i < 10; i++) ls[i] = ls[i - 1] + line[i];
#if 0
		cerr << dist << endl;
		cerr << "begin" << endl;
		for(int i=0,n=ls.size(); i<n;i++) cerr << ls[i] << endl;
		cerr << "end" << endl;
#endif
		cout << (lower_bound(all(ls), dist) - ls.begin()) + 1 << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
typedef complex<double> P;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 30;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };

int l[10], v1, v2;
int main() {
	while ( ~scanf( "%d,", &l[ 0 ] ) ) {
		int s = l[ 0 ];
		for ( int i = 1; i < 10; i++ ) {
			scanf( "%d,", &l[ i ] );
			s += l[ i ];
		}
		scanf( "%d,%d", &v1, &v2 );
		double t = 1. * s / ( v1 + v2 );
		double M = t * v1;
		int ans = 0;
		while ( M > 0 ) {
			M -= l[ ans ];
			++ans;
		}
		printf( "%d\n", ans );
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>

//#define PI 3.141592653589

using namespace std;



int main()
{
	int l[10];
	int v[2];
	int sum;
	double point;	//すれ違う地点
	int sum2;	//計算に使う駅間の距離の合計
	
	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]) != EOF)
	{
		sum = 0;
		sum2 = 0;
		for (int i=0; i<10; i++) sum += l[i];
		//cout << "sum = " << sum << endl;
		point = 1.0 * sum * v[0] / (v[0] + v[1]);
		//cout << "point = " << point << endl;
		for (int i=0; i<10; i++)
		{
			sum2 += l[i];
			if (sum2 >= point)
			{
				cout << i+1 << endl;
				break;
			}
		}
	}
	
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    for(;;){
        char c;
        vector<int> len(10);
        for(int i=0; i<10; ++i){
            if(!(cin >> len[i] >> c))
                return 0;
        }
        int v1, v2;
        cin >> v1 >> c >> v2;

        int sumLen = accumulate(len.begin(), len.end(), 0);
        int tmp = 0;
        for(int i=0; i<10; ++i){
            tmp += len[i];
            if(sumLen * v1 <= tmp * (v1 + v2)){
                cout << (i+1) << endl;
                break;
            }
        }
    }
}