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 <string>
#include <string.h>
#include <vector>
#include <cstdlib>
using namespace std;

vector<string> split(const string &str, char delim){
  vector<string> res;
  size_t current = 0, found;
  while((found = str.find_first_of(delim, current)) != string::npos){
    res.push_back(string(str, current, found - current));
    current = found + 1;
  }
  res.push_back(string(str, current, str.size() - current));
  return res;
}

int main()
{
	string s;
	while(cin >> s)
	{
		vector<string> _s = split(s,',');
		int *values = new int[11];
		double *v = new double[2];

		for(int i=0;i<11;i++)
		{
			if(i == 0)
			{
				values[i] = 0;
			}
			else
			{
				values[i] = std::atoi(_s[i-1].c_str()) + values[i-1];
			}
			
		}

		for(int i=0;i<2;i++)
		{
			v[i] = std::atoi(_s[i+10].c_str());
		}
		double temp = v[0] / (v[0]+v[1]);
		temp *= values[10];

		bool flag = true;
		for(int i=0;i<10;i++)
		{
			if(values[i] <= temp && temp <= values[i+1] && flag)
			{
				cout << i+1 << endl;
				flag = false;
			}
		}
	}
	return 0;
}

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

int main(){
	int ans;
	double l[10], sum;
	double v1, v2, t;
	char k;

	while(1){
		sum=ans=0;
		for(int i=0; i<10; i++){
			cin>>l[i]>>k;
			sum+=l[i];
		}
		cin>>v1>>k>>v2;
		if(cin.eof())break;

		t=sum/(v1+v2);//ツ猟キツ人ツ算

		sum=0;

		while(t*v1>sum){//t*v1ツづ債つキツづェツ暗。ツつ、ツ仰猟猟」
			sum+=l[ans];
			ans++;
		}
		cout<<ans<<"\n";

	}
	
	return 0;
}

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

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>
#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 length=0;
		for(int i=0;i<10;i++){
			length += l[i];
		}
		double x=v1*length/(double)(v1+v2);
		double sum=l[0];
		for(int j=1;j<10;j++){
			if(sum>=x){
				cout<<j<<endl;
				break;
			}
			sum += l[j];
		}
	}
	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);
		down.wantVRatio(up.v);
		up.wantDistance(railsum);
		down.wantDistance(railsum);

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

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

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

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	int l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, v1, v2, sum, i;
	double ter;
	vector<int> s;
	while (scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &l1, &l2, &l3, &l4, &l5, &l6, &l7, &l8, &l9, &l10, &v1, &v2) != EOF) {
		s.clear();
		s.push_back(l1);
		s.push_back(l2);
		s.push_back(l3);
		s.push_back(l4);
		s.push_back(l5);
		s.push_back(l6);
		s.push_back(l7);
		s.push_back(l8);
		s.push_back(l9);
		s.push_back(l10);
		sum = l1 + l2 + l3 + l4 + l5 + l6 + l7 + l8 + l9 + l10;
		ter = (double(sum*v1)) / (v1 + v2);
		sum = 0;
		for (i = 0; i < 10; i++) {
			sum += s[i];
			if (ter <= (double)sum) {
				cout << i + 1 << endl;
				break;
			}
		}
	}
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <map>

using namespace std;

int main(){
	int a[12];
	char c[11];
	int ans = 0;
	for(int i = 0;i < 12;i++){
		if(i < 11) cin >> a[i] >> c[i];
		else cin >> a[i];
	}
	double t = 0, d = 0;
	int sum = 0;
	for(int i = 0;i < 10;i++){
		sum += a[i];
	}
	t = (double)sum / (a[10]+a[11]);
	d = (double)a[10] * t;
	sum = 0;
	for(int i = 0;i < 10;i++){
		sum += a[i];
		if(sum > d){
			ans = i + 2;
			break;
		}
		else if(sum == d){
			ans = i + 1;
			break;
		}
	}
	cout << ans << endl;

	return 0;
}

C++: //0034
//include-------------------------------------
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<stack>

using namespace std;

//typedef--------------------------------------
typedef vector<int> VI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

#define MP make_pair

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

//constant-------------------------------------
const double PI = acos(-1.0);

//cout,cin-------------------------------------
#define COUT(x) cout<<(x)<<endl
#define CIN(x) cin>>(x)

int main(){

	int l[10], v1, v2;
	char a;

	while (cin>>l[0]>>a){
		int L = 0;
		int ans = 0;
		int sum = 0;
		double x, k;
		
		FOR(i,1,10) {
			cin >> l[i] >> a; L += l[i];
		}
		cin >> v1 >> a >> v2;

		k = v1*1.0 / v2;
		x = 1.0*L*k / (1 + k);

		while (sum < x){
			sum += l[ans++];
		}

		COUT(ans);
	}

	return 0;

}