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

int main(){
	int a[10];
	int v1,v2;
	while(cin >> a[0]){
		char com;
		for(int i=1;i<10;i++) cin >> com >> a[i];
		cin >> com >> v1 >> com >> v2;
		int l = 0;
		for(int i=0;i<10;i++){
			l += a[i];
			a[i] *= v1+v2;
		}
		l *= v1;
		int s = 0;
		for(int i=0;i<10;i++){
			s += a[i];
			if(l<=s){
				cout << i+1 << endl;
				break;
			}
		}
	}
}

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

int main()
{
	int l[10];
	int 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) > 0){
		int suml = 0;
		for(int i=0; i<10; i++){
			suml += l[i];
		}
		double time = 1.0*suml / (v1+v2);
		double miti = time*v1;
		int ans = 0;
		for(int i=0, sl=0; i<10; i++){
			if(miti < sl){
				ans = i;
				break;
			}
			sl += l[i];
		}
		cout<<ans<<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,sum,ret;
	vector<int> l(10, 0);
	while (scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n", &l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&l[10],&v1,&v2)) {
		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<iostream>
#include<cstdio>
using namespace std;
#define dff 1e-9
int main(){
  double x[10],va,vb;
  for(;;){
    if(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x[0],&x[1],&x[2],&x[3],&x[4],&x[5],&x[6],&x[7],&x[8],&x[9],&va,&vb) == EOF) break;
    double l = 0,t,ll = 0;
    for(int i=0; i<10; i++) l+=x[i];
    t = l/(va+vb);
    l = t*va;
    for(int i=0; i<10; i++){
      ll+=x[i];
      if(ll>l || (-dff<ll-l && ll-l<dff)){
	cout <<i+1<<endl;
	break;
      }
    }
  }
  return 0;
}

C++: #include<stdio.h>
int a[10];
int v1,v2;
int main(){
	while(~scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",a,a+1,a+2,a+3,a+4,a+5,a+6,a+7,a+8,a+9,&v1,&v2)){
		int s=0;
		for(int i=0;i<10;i++)s+=a[i];
		double t=(double)s*(double)(v1)/(double)(v1+v2);
		double now=0;
		int ret=1;
		for(int i=0;i<10;i++){
			now+=a[i];
			if(now<t)ret++;
		}
		printf("%d\n",ret);
	}
}

C++: #include<iostream>

using namespace std;

int main()
{
	double v1,v2,l[10];
	int i;
	char a;
	
	for(;cin >> l[0];)
	{
		double n=l[0];
		for(i=1;i<10;i++)
		{
			cin >> a >> l[i];
			n+=l[i];
		}
		cin >> a >> v1 >> a >> v2;
		double t;
		t=n/(v1+v2);
		n=v1*t;
		for(i=0;i<10;i++)
		{
			n-=l[i];
			if(0.0==n)
			{
				i++;
				break;
			}
			if(0.0>n)
			{
				i++;
				break;
			}
		}
		cout << i << endl;
	}
}

C++: #include<iostream>

using namespace std;

int main()
{
	int i,c;
	double vsum,lsum,t,v1l;
	int v1,v2;
	int l[11];

	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)
	{
		lsum=0;
		vsum=v1+v2;
		for(i=1;i<11;i++)
			lsum+=l[i];
		t=lsum/vsum;
		v1l=t*v1;
		i=1;
		while(v1l>0){
			v1l-=l[i];
			i++;
		}

		printf("%d\n",--i);
	}
	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#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];
		}
		int speed = b + c;
		double x = dis / speed*b;
		int j = 0;
		while (1) {
			if (x - a[j] < 0) { break; }
			x -= a[j];
			j++;
		}
		cout << j + 1 << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<map>
#include<queue>
#include<set>

using namespace std;
typedef pair<int,int> PII;
typedef long long ll;

int main(){
  int len[10],l1,l2,pos;
	while(scanf("%d",&len[0])+1){
		for(int i=1;i<10;i++){
			scanf(",%d",&len[i]);
			len[i] += len[i-1];		
		}
		scanf(",%d,%d",&l1,&l2);
		pos = len[9] * l1;
		int ans;
		for(int i=0;i<10;i++){
			if(len[i] * ( l1 + l2 )  < pos)
				ans = i;
			else
				break;
		}
		ans += 2;
		cout<<ans<<endl;
	}
	
  return 0;
}

C++: #include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
void getValue(string& line, int* D, int& v1, int& v2){
	string::size_type p1 = 0;
	string::size_type p2 = line.find(',');
	int k, i = 0;
	while (p1 != string::npos){
		if (p1 == 0) k = atoi(line.substr(0, p2).c_str());
		else if( p2 != string::npos)	k = atoi(line.substr(p1 + 1, p2 - p1 - 1).c_str());
		else k = atoi(line.substr(p1 + 1).c_str());
		if (i < 10) D[i] = k;
		else if (i == 10) v1 = k;
		else if (i == 11) v2 = k;
		p1 = p2;
		++i;
		if(p1 != string::npos)
			p2 = line.find(',', p1 + 1);
	}
}
int main()
{
	int D[10] = {}, S[10] = {};
	int v1, v2, d, v;
	string line;
	while (cin >> line){
		getValue(line, D, v1, v2);
		d = 0;
		for (int i = 0; i < 10; ++i){
			d += D[i];
			if (0 == i) S[0] = D[i];
			else		S[i] = S[i - 1] + D[i];
		}
		v = v1 + v2;
		double t = (double)d / (double)v;
		double a = t * v1;
		int b = 0;
		for (int i = 0; i < 10; ++i){
			if (0 == i){
				if (a <= S[0]){
					b = 1;
					break;
				}
			}
			else{
				if (S[i - 1] < a && a <= S[i]){
					b = i + 1;
					break;
				}
			}
		}
		cout << b << "\n";
	}
	return 0;
}