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 <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);
		down.wantVRatio(up.v);

		while(1){
			int uptmp = 0, downtmp = 0;
			up.wantDistance(railsum);
			down.wantDistance(railsum);

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

			MREP(i, down.currentSta, up.currentSta){
				down.distance -= rail[i];
				if(down.distance < rail[i]){
					downtmp = i;
					break;
				}
			}

			up.currentSta = uptmp;
			down.currentSta = downtmp;

			if((down.currentSta - up.currentSta) >= 3){
				int sum = 0;
				PREP(i, up.currentSta, down.currentSta){
					sum += rail[i];
				}
				railsum = sum;
			}
			else if((down.currentSta - up.currentSta) == 2){
				//この2の内訳は、インデックスが0~9までに対して問題の区間番号が1~10定義になっているので+1と
				//仮に各電車の区間番号が5,7だった場合、すれ違うのは6なので5+1のための+1
				cout << up.currentSta + 2 << endl;
				break;
			}
			else{
				//インデックスが0~9までに対して問題の区間番号が1~10定義になっているので+1
				cout << (up.currentSta > down.currentSta ? down.currentSta + 1 : up.currentSta + 1) << endl;
				break;
			}
		
		}
	
	}
	return 0;
}

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

int main()
{
    int l[11];
    int v1,v2;

    scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
            &l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&l[10],
            &v1,&v2);
    
    int t,la,lsum=0;
    for(int i=1;i<=10;++i){
        //change km to m
        l[i] *= 100000;
        //cout << l[i] << endl;
        lsum+= l[i];
    }
    
    t = lsum/(v1+v2);
    //cout << t << endl;
    la = v1*t;
    //cout << la << endl;
    lsum = 0;
    for(int i=1;i<=10;i++)
    {
        lsum += l[i];
        if(lsum >= la){ cout << i << endl; break;}
    }


    return 0;
}

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

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

int main(){

int l[10];
float li=0;
float lSum=0;
float v1,v2;
int i=0;
char c;

while(true){
for(i=0;i<10;i++){
	cin>>l[i]>>c;
	lSum+=l[i];
}

cin>>v1>>c>>v2;

for(i=0;;i++){
	li+=l[i];
	if(lSum*(v1/(v1+v2))-li<=0)
		break;
}
cout<<i+1<<endl;
}
}

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

using namespace std;

int main(){
    vector<int> v(10);
    int sp1, sp2;
    double all=0, sp_sum;

    while(cin>>v.at(0)){
        for(int i=1; i<10; i++){
            cin>> v.at(i);
        }
        cin>> sp1>> sp2;

        for(int i=0; i<10; i++){
            all += v.at(i);
        }
        sp_sum = sp1+sp2;

        double hour = all/sp_sum;
        double x = sp1*hour;

        int k = 0;
        while(x>0){
            x -= v.at(k);
            k++;
        }

        cout<< k<< endl;
    }

    return 0;
}

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

#define SIZE 10

int main() {
	int l[SIZE] = { 0 }, v1, v2;
	double s;
	char t;
	while (cin >> l[0]) {
		if (l[0] == EOF) break;
		s = l[0];
		for (int i = 1; i < SIZE; i++) {
			cin >> l[i];
			cin >> t;

			s += l[i];
		}
		cin >> v1 >> t >> v2;
		s = s * v1 / (v1 + v2);

		for (int i = 0; i < 10; i++) {
			s -= l[i];
			if (s <= 0) {
				cout << i + 1 << endl;
				break;
			}
		}
	}
	return 0;
}

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

using namespace std;

int main() {
    int l[10], v1, v2;
    int length = 0;
    // 二点間の距離と、各点から始まる速度を与えたときに交差する点の位置を返す
    auto crossPoint = [&]() {
        // 交差した瞬間、それぞれの列車の変位は一致する
        // よって、交差する時間をt、距離をlとすると、
        // 「v1*t = l-v2*t」より、tについて解くと「t = l / (v1 + v2)」、
        // よって、変位は「(v1 * l) / (v1 + v2)」となる。
        return (double)(v1 * length) / (double)(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)) {
        length = accumulate(l, l+10, 0);
        double pos = crossPoint();          // 列車の交差時間の取得
        int i = 1, ls = l[0];               // 区間の計算

        while(ls < pos) { ls += l[i++]; }
        cout << i << endl;
    }

    return 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 y = static_cast<int>(x);
		int j = 0;
		while (1) {
			if( y - a[j] <= 0) { break; }
			y -= a[j];
			j++;
		}
		cout << j + 1 << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
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 gou = 0,kaku = 0;
		for (int i = 0; i < 10; ++i)
			gou += l[i];
		double are = (double)gou*v1/(v1+v2);
		int ans;
		for (int i = 0; i < 10; ++i)
		{
			kaku += l[i];
			if(kaku >= are)
			{
				ans = i + 1;
				break;
			}
		}
		cout << ans << endl;
	}
}

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

int main(){
	std::vector<int> distance(10);
	int a=0;
	int sum=0;
	char dummy;
	for(int i=0;i<10;++i){
		int s;
		std::cin>>s;
		std::cin>>dummy;
		sum+=s;
		a+=s;
		distance[i]=a;
	}
	double v1,v2;
	std::cin>>v1>>dummy>>v2;
	int ans=0;
	for(int i=0;i<10;++i){
		if(distance[i]<=sum/(v1+v2)*v1){
			ans=i+1;
		}
	}
	std::cout<<ans<<std::endl;
	return 0;
}