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 l[10];
	int v1,v2;
	
	while(scanf("%d,",&l[0])!=EOF){
		for(int i=1;i<10;i++){
			scanf("%d,",&l[i]);
		}
		scanf("%d,%d",&v1,&v2);
		double sum=0;
		for(int i=0;i<10;i++){
			sum+=l[i];
		}
		double ld=((double)(sum/(v1+v2)))*(double)v1;
		int result=0;
		for(int i=0;i<10;i++){
			if(ld>l[i]){
				ld-=l[i];
				result++;
			}
			else{
				result++;
				break;
			}
		}
		printf("%d\n",result);
	}
}

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

int main()
{
    while(true){
        char c;
        int line[10],v[2],allLength=0,length=0;;
        double lengthPer,passLength;
        for(int i=0;i<10;i++){
            cin>>line[i]>>c;
            if(cin.eof()){
                return 0;
            }
            allLength += line[i];
        }
        cin>>v[0]>>c>>v[1];
        lengthPer=(double)v[0]/((double)v[0]+(double)v[1]);
        passLength=(double)allLength*lengthPer;
        for(int i=0;i<10;i++){
            length += line[i];
            if(passLength<(double)length){
                cout<<i+1<<endl;
                length=0;
                break;
            }
            if(passLength==(double)length){
                cout<<i+1<<endl;
                length=0;
                break;
            }
        }
    }
}

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

int main(){
	while (true)
	{
		double l[11] = {}, v[3];
		int ans;
		char knm;
		for(int i=0;i<10;i++){
			cin >> l[i] >> knm;
			l[10] += l[i];
		}
		if (cin.eof()) { break; }
		cin >> v[0] >> knm >> v[1];
		v[2] = v[0] + v[1];
		l[10] = l[10] * v[0] / v[2];
		for(ans = 0; ans<10;ans++){
			l[10] -= l[ans];
			if(l[10]<=0){
				break;
			}
		}
		cout << ans + 1 << endl;
	}

}

C++: #include <iostream>
using namespace std;
int main(){
	int l[10], v[2], sl;
	char c;
	while(cin >> l[0]){
		sl = l[0];
		for(int i = 1; i < 10; i++){
			cin >> c >> l[i];
			sl += l[i];
		}
		cin >> c >> v[0] >> c >> v[1];
		for(int i = 0; i < 10; i++){
			l[i] *= v[0] + v[1];
		}
		sl *= v[0];

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

C++: #include <iostream>

using namespace std;

int main() {
	int l[10];
	int v1, v2;
	char d;
	int sum;
	double kyori;
	while (cin >> l[0]) {
		sum = l[0];
		cin >> d;
		for (int i = 1; i < 10; i++) {
			cin >> l[i] >> d;
			sum += l[i];
		}
		cin >> v1 >> d >> v2;
		kyori = (double)v1 * (double)sum / (double)(v1+v2);
		for (int i = 9; i >= 0; i--) {
			sum -= l[i];
			if (sum < kyori) {
				cout << i+1 << endl;
				break;
			}
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
double l[11], a, b, sum, dis; char d;
int main() {
	while (cin >> l[1] >> d >> l[2] >> d >> l[3] >> d >> l[4] >> d >> l[5] >> d >> l[6] >> d >> l[7] >> d >> l[8] >> d >> l[9] >> d >> l[10] >> d >> a >> d >> b) {
		sum = 0;
		for (int i = 1; i <= 10; i++) {
			sum += l[i];
		}
		dis = 1.0*sum*(a / (a + b));
		sum = 0;
		for (int i = 1; i <= 10; i++) {
			sum += l[i];
			if (sum >= dis) { cout << i << endl; break; }
		}
	}
}

C++: #include <cstdio>

using namespace std;

double l[10],v1, v2;

int main()
{
    loop:
    while ( scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf\n", &l[0], &l[1], &l[2], &l[3], &l[4], &l[5], &l[6], &l[7], &l[8], &l[9], &v1, &v2 ) != EOF )
    {
        v2 += v1;
        for( int i = 0; i < 10; i++ )
        {
            l[i] += ( ( i == 0 ) ? 0 : l[i - 1] );
        }
        double t = l[9] / v2;
        double dis = v1 * t;
        for( int i = 0; i < 10; i++ )
        {
            if( dis == l[i] )
            {
                printf( "%d\n", i + 1 );
                goto loop;
            }
            else if( dis < l[i] )
            {
                printf( "%d\n", i + 1 );
                goto loop;
            }
        }
        /* for( int i = 0; i < 10; i++ )
        {
            if( l[i] <= dis && dis <= l[i + 1] )
            {
                printf( "%d\n", i + 2 );
                return 0;
            }
        } */
    }
    return 0;
}

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

using namespace std;

int main(void)
{
    int line[10];
    double lina[10];
    double linb[10];

    while (scanf("%d,", &line[0]) != EOF) {
        int dist = line[0];
        for (int i = 1; i < 10; i++) {
            scanf("%d,", &line[i]);
            dist += line[i];
        }
        int n, m;
        scanf("%d,%d", &n, &m);
        double d = (double)dist * (double) n / (n + m);
        dist = 0;
        for (int i = 0; i < 10; i++) {
            dist += line[i];
            if (dist >= d) {
                cout << i+1 << endl;
                break;
            }
        }
    }

    return 0;
}

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

int main() {
	int ar[12];
	int dis=0;
	int speed;
	int x=0;
	while (1) {
		for (int i = 0; i < 12; i++) {
			scanf("%d,", &ar[i]);
		}
		if (ar[0] == EOF) {	break;}
		for (int i = 0; i < 10; i++) { dis += ar[i]; }
		int speed = ar[10] + ar[11];
		int a = (dis + speed - 1) / speed;
		while (1) {
			if (a - ar[x] < 0) { break; }
			a -= ar[x];
			x++;
		}
		cout << x << 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,ret;
	double sum=0;
	vector<int> l(10, 0);
	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) {
		sum = 0;
		for (int i=0; i<10; i++) {
			sum += l[i];
		}
		sum /= (v1+v2);
		sum *= v1;
		for (int i=0; i<10; i++) {
			sum -= l[i];
			if (sum <= 0) {
				ret = i+1;
				break;
			}
		}
		cout << ret << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
using namespace std;
int main() {
  int b[10],k[10],i,v1,v2;
  double h;
  v1=3; v2=8;
  h=(double)v1*v1/v2;
  cout << h << endl;
  while (cin >> b[0] >> b[1] >> b[2] >> b[3] >> b[4] >> b[5] >> b[6] >> b[7] >> b[8] >> b[9] >> v1 >> v2) {
    k[0]=b[0];
	for (i=1;i<10;i++) k[i]=k[i-1]+b[i];
	h=(double)v1*k[9]/(v1+v2);
	for (i=0;i<10;i++) if (h>=k[i]-b[i] && h<=k[i]) break;
	cout << i+1 << endl;
  }
  return 0;
  }

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

int main(void){
	int l[10];
	char c;
	double ls, x1, t, v1, v2;
	while(!cin.eof()){
		ls = 0;
		for(int i = 0; i < 10; i++){
			cin >> l[i] >> c;
			ls += l[i];
		}
		cin >> v1 >> c >> v2;
		
		x1 = t = 0.0;
		for(int i = 0; i < 10; i++){
			x1 += l[i];
			t = x1 / v1;
			if(x1 + t * v2 >=ls){
				cout << ++i << endl;
				break;
			}
		}
	}
	return 0;
}