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 <algorithm>
#include <array>
#include <iostream>
#include <numeric>
#include <sstream>
#include <string>

using std::accumulate;
using std::array;
using std::cin;
using std::cout;
using std::endl;
using std::for_each;
using std::getline;
using std::replace;
using std::string;
using std::stringstream;

int main() {
	string input;
	while (getline(cin,input)) {
		replace(input.begin(),input.end(),',',' ');
		array<int,10> len; // length of each section
		stringstream str_in(input);
		for_each(len.begin(),len.end(),[&str_in](int& l){str_in >> l;});
		int v1,v2; // velocity of each train
		str_in >> v1 >> v2;

		double total_time = accumulate(len.begin(),len.end(),0)/static_cast<double>(v1+v2);
		double total_len = total_time*v1; // total length the train passes
		int pass_len = 0; // the length the train passes
		int section = 0; // the number of section where the train passes
		while (pass_len < total_len) {
			pass_len += static_cast<double>(len[section++]);
		}
		cout << section << 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){
			if(i!=9)ans=i+1;
		}
	}
	std::cout<<ans<<std::endl;
	return 0;
}

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


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

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

int main(void){
  int l[10];
  double v1, v2;
  char c;
  while(!cin.eof()){
    int ls = 0;
    for(int i = 0; i < 10; i++){
      cin >> l[i] >> c;
      ls += l[i];
    }
    cin >> v1 >> c >> v2;
    
    double vr = v1 / v2;
    double x = (vr * ls) / (1 + vr);

    double y = 0.0;
    int cnt = 0;

    while(y < x){
      y += l[cnt];
      cnt++;
    }
    cout << cnt << endl;
  }
  return 0;
}

C++: #include <algorithm>
#include <cstdio>

using namespace std;

int main() {
  int l[11], v1, v2;
  while (scanf("%d", l+1) == 1) {
    l[0] = 0;
    for (int i = 2; i < 11; i++) {
      scanf(",%d", l+i);
      l[i] += l[i-1];
    }
    scanf(",%d,%d\n", &v1, &v2);
    printf("%d\n", lower_bound(l, l+11, double(l[10]*v1)/double(v1+v2))-l);
  }
  return 0;
}

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 len = sp1*hour;

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

        cout<< k<< endl;
    }

    return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	int a[11];
	double s, t, v1, v2;
	
	while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%lf,%lf",
				&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],&a[9],&a[10],&v1,&v2)!=EOF){
		s = 0;
		for(int i = 1; i <= 10; i++){
			s += a[i];
		}
		t = s/(v1+v2);
		s = 0;
		for(int i = 1; i <= 10; i++){
			s += a[i];
			if(s >= v1*t){
				cout << i << endl;
				break;
			}
		}
	}
	
	return 0;
}

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

int main()
{
    int l[10] , v1 , v2 , n , m;
    double d , t;
    char ch;
    while(cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2>>ch){
        t=n/(v1+v2);
        d=v1*t;    //列車1の動く距離
        m=0;
        for(int i=0;i<10;i++){
            m+=l[i];
            if(m>=d){
                cout << i << endl;
                break;
            }
        }
    }
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
double a[15],b;
signed main(void){
	while(scanf("%lf,",&a[1])!=EOF){
		for(int i=2;i<12;i++)
			scanf("%lf,",&a[i]);
		scanf("%lf",&a[12]);
		b=0;
		for(int i=1;i<=10;i++)
			b+=a[i];
		b=(b*a[11])/(a[11]+a[12]);
		for(int i=1;i<=10;i++){
			b-=a[i];
			if(b<=0){
				printf("%d\n",i);
				break;	
			}
		}
	}
}

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

int main()
{
        const int MAX = 10;
        int l[MAX];
        int v1, v2;
        int sumL;

        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) {
                sumL = 0;
                for (int i = 0; i < MAX; i++) {
                        sumL += l[i];
                }
                float l1 = v1 * ((float)sumL / (v1 + v2));
                for (int i = 0; i < MAX; i++) {
                        l1 -= l[i];
                        if (l1 <= 0.0) {
                                printf("%d\n", i+1);
                                break;
                        }
                }
        }

        return 0;
}

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

using namespace std;

int main()
{
	int l[10],v[2];
	while(~scanf("%d",l)){
		for(int i=1;i<10;i++)	scanf(",%d",l+i);
		scanf(",%d,%d",v,v+1);
		int len=accumulate(l,l+10,0);
		vector<int> rail(len);
		for(int i=0,cnt=0;i<10;i++){
			for(int j=0;j<l[i];j++,cnt++){
				rail[cnt]=i+1;
			}
		}
		double x=1.0*v[0]/(v[0]+v[1])*len;
		if(-1e-9<(x-(int)x) && (x-(int)x)<1e-9)	x-=0.1;
		printf("%d\n",rail[(int)x]);
	}
	return 0;
}

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

int main(){
	int l[12], v1, v2;
	double sum,sum2;

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

	        sum = 0;
		for(int i=1 ; i<=10 ; i++){
			sum += l[i];
		}
		sum2 = ((double)sum)/(double)((v1+v2))*(double)(v1);
		sum = 0;
		for(int i=1 ; i<=10 ; i++){
			sum += l[i];
			if( sum <= sum2 ){
				printf("%d\n", i);
				break;
			}
		}
	}
        return 0;
}