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>

#define N 10

int main(void){
    int len[N], totalLn;
    int v1, v2;
    double joinTm, joinPt;
    
    while(1){
        if (scanf("%d,", &len[0]) ==EOF) break;
        totalLn = len[0];
        for (int i=1; i<N; i++){
            scanf("%d,", &len[i]);
            totalLn += len[i];
        }
        scanf("%d,%d", &v1, &v2);
        joinTm = (double)totalLn / (v1 + v2);
        joinPt = joinTm * v1;
        for (int i=0; i<N; i++){
            joinPt-=len[i];
            if (joinPt <= 0){
                printf("%d\n", i+1);
                break;
            }
        }
    }
    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,sum,ret;
	vector<int> l(10, 0);
	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 = (l[1]+l[2]+l[3]+l[4]+l[5]+l[6]+l[7]+l[8]+l[9]+l[10])*(int)(v1/(v1+v2));
		for (int i=0; i<10; i++) {
			sum -= l[i];
			if (sum <= 0) {
				ret = i;
				break;
			}
		}
		cout << ret << endl;
	}
	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[0]=i;
		printf("%d\n",x[0]);
	}
	
return 0;
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(){
	double l[10],v1,v2,x;
	double ans;
	char c;
	while(cin>>l[0]>>c>>l[1]>>c>>l[2]>>c>>l[3]>>c>>l[4]>>c>>l[5]>>c>>l[6]>>c>>l[7]>>c>>l[8]>>c>>l[9]>>c>>v1>>c>>v2){
		x=0;
		for(int i=0;i<10;i++){
			x+=l[i];
		}
		ans=x*v1/(v1+v2);
		int n=0,s=0;
		while(1){
			s+=l[n];
			if(ans<=s){
				cout<<n+1<<endl;
				break;
			}
			n++;
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

#define fs first
#define sc second
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define pb emplace_back

using pii = pair<int, int>;
using vi = vector<int>;
using lint = long long;

const int inf = 1001001001;
const lint linf = 1001001001001001001ll;
const int mod = 1e9 + 7;
const int dx[]{0, 1, 0, -1, -1, -1, 1, 1}, dy[]{1, 0, -1, 0, -1, 1, -1, 1};

template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; } return a > b; }
template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; } return a < b; }
template<typename T> inline void print(const T &x, string s = "\n") { cout << x << s; }
template<typename T> inline void print(const vector<T> &v, string s = " ") 
{ rep(i, v.size()) cout << v[i] << (i + 1 == v.size() ? "\n" : s); }
inline bool inside(int y, int x, int H, int W) { return 0 <= y && y < H && 0 <= x && x < W; }
inline lint in() { lint x; std::cin>>x; return x; }

int main() {
	int l[10], u, v;
	char c;

	while (cin >> l[0] >> c) {
		rep(i, 9) cin >> l[i + 1] >> c;
		cin >> u >> c >> v;

		for (int i = 1; i < 10; ++i) {
			l[i] += l[i - 1];
		}

		double d = (double)l[9] / (u + v) * u;
		for (int i = 0; i < 10; ++i) {
			if (l[i] >= d) {
				cout << i + 1 << endl;
				break;
			}
		}
		//rep(i, 10) cout << l[i] << endl;
		//cout << u << endl;
	 	//cout << v << endl;
	}
}

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

int main()
{
	int l[10], v1, v2, cnt;
	double n, d, t;
	char ch;
	while (cin>>l[0]>>ch){
		n = l[0];
		for (int i = 1; i < 10; i++)
		{
		    cin >> l[i] >> ch;
		    n += l[i];
		}
		cin >> v1 >> ch >> v2;
		t=n/(v1+v2);
		d=v1*t;    //列車1の動く距離
		cnt=0;
		while(d>0){
			d -= l[cnt];
			cnt++;
		}
		cout << cnt << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip> 
#include <complex> 
#include <string>
#include <vector> 
#include <list>
#include <deque> 
#include <stack> 
#include <queue> 
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm> 
#include <numeric> 
#include <typeinfo> 
#include <cstdio>
#include <cstdlib> 
#include <cstring>
#include <cmath>
#include <climits> 
#include <ctime>

using namespace std;

int rail[11],railal=0,sp[2];
double  c1,c2,t;
int main(void){
	int a;
	while(~scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&rail[1],&rail[2],&rail[3],&rail[4],&rail[5],&rail[6],&rail[7],&rail[8],&rail[9],&rail[10],&sp[0],&sp[1])){
		railal=0;
		for(a=1;a<=10;a++)railal+=rail[a];
		c1=(double)sp[0]/3600;
		c2=(double)sp[1]/3600;
		for(a=1;a<=10;a++){
			t+=(double)rail[a]/c1;
			if((double)t*(sp[0]+sp[1])/3600>=railal){
				cout << a << endl;
				break;
			}
		}
	}
	return 0;
}

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

int main(void)
{
	int L[10];
	int V[2];
	char C[11];

	while(cin >> L[0] >> C[0])
	{
		for(int i=1; i<10; i++)
			cin >> L[i] >> C[i];
		cin >> V[0] >> C[10] >> V[1];

		int sum = 0;
		for(int i=0; i<10; i++)
			sum += L[i];

		double col_point = 0;
		col_point = ((double)sum)/((double)V[0]+V[1])*V[0];

		int ruikei = 0;
		for(int i=0; i<10; i++)
		{
			ruikei += L[i];
			if(col_point <= ruikei)
			{
				cout << (i+1) << endl;
				break;
			}
		}
	}
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }

int main()
{
	vint line(10);
	float v1, v2;

	rep(i, 10)
		cin >> line[i];
	cin >> v1 >> v2;


	float sum = accumulate(ALL(line), 0);

	float cross = sum / (v1 + v2) * v1;

	partial_sum(ALL(line), line.begin());

	rep(i, 10)
		if(cross <= line[i])
		{
			cout << i + 1 << endl;
			return 0;
		}	
}