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 <stdio.h>

int main(){
  int data[10];
  int v,w;
  while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", data, data+1, data+2, data+3, data+4, data+5, data+6, data+7, data+8, data+9, &v, &w)!=EOF){
    for(int i=1;i<10;i++) data[i] += data[i-1];

    double x = data[9]*v/(double)(v+w);

    for(int i=0;i<10;i++) {
      if(data[i] >= x){
        printf("%d\n", i+1);
        break;
      }
    }
  }
}

C++: #include <stdio.h>

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

C++: #include <iostream>

using namespace std;

int Solution(int l[10],int v[2])
{
    double sum=0;
    
    double t;
    
    double len;
    
    for(int i = 0; i < 10; i++)
    {
        sum += l[i];
    }
    
    t = sum / (v[0] + v[1]);
    
    len = v[0] * t;
    
    sum = 0;
    
    for(int i = 0; i < 10; i++)
    {
        sum += l[i];
        
        if(len <= sum)
        {
            return i+1;
        }
    }
}

int main()
{
    int l[10];
    int v[2]; // v1, v2
    
    char comma;
    
    while(cin >> l[0])
    {
        for(int i = 1; i < 10; i++)  //data input
        {
            cin>>comma>>l[i];
        }
        
        for(int i = 0; i < 2; i++)
        {
            cin>>comma>>v[i];
        }
        
        cout<<Solution(l, v)<<endl;
    }
    
    return 0;
}

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

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs(a-b) < EPS)

int main(){


	int l[10];
	int station[11];
	char cm;
	while(cin>>l[0]>>cm>>l[1]>>cm>>l[2]>>cm>>l[3]>>cm>>l[4]>>cm>>l[5]>>cm>>l[6]>>cm>>l[7]>>cm>>l[8]>>cm>>l[9]){
		int sumlength=0;
		for(int i = 0; i < 10; i++)
			sumlength+=l[i];
		station[0]=0;
		for(int i = 1; i < 11; i++){
			station[i]=station[i-1]+l[i-1];
		}
		int v1,v2;
		cin>>cm;
		cin>>v1>>cm>>v2;
		double t = (double)(sumlength)/(v1+v2);
		double place=t*v1;
		for(int i = 0; i < 11; i++){
			if(EQ(station[i],(place))){
				cout<<i<<endl;
				break;
			}
			else if(station[i]<(place) && station[i+1] >(place)){
				cout<<i+1<<endl;
				break;
			}
		}
	}

	return 0;
}

C++: #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
using namespace std;

#define pb         push_back
#define mp         make_pair
#define ll         long long
#define PI         acos(-1.0)
#define ALL(A)     ((A).begin(), (A).end())
#define vsort(v)   sort(v.begin(),v.end())
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)

int main(){
    double v1, v2, l[10];
    while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &l[0],&l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&v1,&v2)){

        double p[11];
        p[0] = 0;
        FOR(i, 1, 11){
            p[i] = p[i-1] + l[i-1];
        }
        FOR(i, 0, 10){
            double vt = (p[10] * v1) / (v1 + v2);
            if(p[i] < vt && p[i+1] >= vt){
                cout << i+1 << endl;
                break;
            }
        }
    }
}

C++: #include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <sstream>
#include <cmath>
#include <climits>
#include <map>

using namespace std;

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

typedef vector<int> vi;

int main()
{
	int l[11] = {0};
	while(1){
		if(scanf("%d,", &l[1]) == EOF)
			break;
		reep(i, 2, 11){
			scanf("%d,", &l[i]);
			l[i] += l[i-1];
		}

		int v1, v2;
		scanf("%d,%d", &v1, &v2);
		printf("%d\n", distance(l, lower_bound(l, l+11, l[10]/double(v1+v2)*v1)));
	}
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<deque>
#include<list>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<map>
#include<queue>
#include<vector>
using namespace std;

int main() {
	while (true) {
		char c;
		int l[11] = {}, v[2], L[11] = {};
		for (int i = 1; i <= 10; i++) {
			cin >> l[i] >> c;
			L[i] = L[i - 1] + l[i];
		}
		cin >> v[0] >> c >> v[1];

		double a = L[10] * (double)v[0] / (v[0] + v[1]);

		for (int i = 1; i <= 10; i++) {
			if (L[i] >= a) {
				cout << i << endl;
				break;
			}
		}
	}

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <map>
#include <stack>
#include <list>
#include <queue>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <math.h>

#define PREP(i, m, n) for(int i = m; i < n; i++)
#define MREP(i, m, n) for(int i = m - 1; i >= n; i--)
using namespace std;

class train{
	public:
		int v;
		double vRatio;
		double distance;
		int currentSta;

		train(int v = 0, double vRatio = 0.0, double distance = 0.0, int currentSta = 0):v(v), vRatio(vRatio), distance(distance), currentSta(currentSta){}
		
		void wantVRatio(int other){
			vRatio = (double)v / ((double)v + (double)other);
		}

		void wantDistance(int railsum){
			distance = (double)railsum * vRatio;
		}
	private:

	protected:

};


int main(){
	while(1){
		map<int, int> rail;
		int railsum = 0;
		train up, down(0,0.0,0.0,10);

		if(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &rail[0], &rail[1], &rail[2], &rail[3], &rail[4], &rail[5], &rail[6], &rail[7], &rail[8], &rail[9], &up.v, &down.v) == EOF){
			break;
		}

		PREP(i, 0, 10){
			railsum += rail[i];
		}

		up.wantVRatio(down.v);
		up.wantDistance(railsum);

		PREP(i, 0, 10){
			if(up.distance <= rail[i]) {
				up.currentSta = i;
				break;
			}
			up.distance -= rail[i];
		}

		//この2の内訳は、インデックスが0~9までに対して問題の区間番号が1~10定義になっているので+1と
		//仮に各電車の区間番号が5,7だった場合、すれ違うのは6なので5+1のための+1
		cout << up.currentSta + 1 << endl;
	}
	return 0;
}

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

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)

const double ESP=1e-10;

int l[10],v1,v2;

int main(){
	do{
		if (scanf("%d,",&l[0])==EOF) break;
		int sum=l[0];
		FOR(i,1,10){
			scanf("%d,",&l[i]);
			sum+=l[i];
		}
		scanf("%d,%d",&v1,&v2);
		double p=(double)sum*v1/(v1+v2);
		double p2=0;
		REP(i,10){
			if (p<=p2+l[i]+ESP){
				printf("%d\n",i+1);
				break;
			}
			p2+=l[i];
		}
	}while(1);
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
using namespace std;

int main(){
	int l[10],v[2];
	char s[11];
	while(cin >> l[0] >> s[0] >> l[1] >> s[1] >> l[2] >> s[2] >> l[3] >> s[3] >> l[4] >> s[4] >> l[5] >> s[5] >> l[6] >> s[6] >> l[7] >> s[7] >> l[8] >> s[8] >> l[9] >> s[9] >> v[0] >> s[10] >> v[1]){
		int total = 0;
		for(int i = 0; i < 10; i++)total += l[i];
		double meet = (double) v[0] * total / (v[0] + v[1]);
		total = 0;
		for(int i = 0; i < 10; i++){
			total += l[i];
			if(( total - l[i] < meet ) && ( meet <= total ))cout << i + 1 << endl;
		}
	}
}