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>
using namespace std;
int main(){
  int a,v1,v2,sum[10];
  char c;
  while(cin >> a >> c){
    sum[0] = a;
    for(int i = 1 ; i < 10 ; i++ ){
      cin >> a >> c;
      sum[i] = a + sum[i - 1];
    }
    cin >> v1 >> c >> v2;
    
    double t = ((double)v1/(v1 + v2))*sum[9];
    for(int i = 0 ; i < 10 ; i++ ){
      if(t <= sum[i] ){
	cout << i + 1 << endl;
	break;
      }
    }
  }
  return 0;
}

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

#define gcu getchar_unlocked
#define ii inline int in
#define is inline bool scan
ii(int c) {
	int n = 0;
	bool minus = false; if (c == '-') minus = true, c = gcu();
	do {n = 10 * n + (c - '0'), c = gcu();} while (c >= '0');
	//return n; }
	return minus ? -n : n; }
ii() {return in(gcu());}
is(int &n) {int c=gcu();return c==EOF?false:(n=in(c),true);}
is(char &c){c=gcu();gcu();return c!=EOF;}
//is(string &s) {int c;for(;;){c=gcu();if(c=='\n'||c==' ')return true;s+=c;}}
#undef ii
#define pcu putchar_unlocked
template <typename T>
void out(T n) {
	static char buf[20];
	char *p = buf;
	if(n < 0) pcu('-'), n *= -1;
	if (!n) *p++ = '0';
	else while (n) *p++ = n % 10 + '0', n /= 10;
	while (p != buf) pcu(*--p); }
void out(const char *s){while(*s)pcu(*s++);}
void out(char c){pcu(c);}
//void out(string &s){for (char c: s) pcu(c);}
template <typename head, typename... tail>
void out(head&& h, tail&&... t){out(h);out(move(t)...);}
template <typename T>
void out(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);out('\n');}
#undef svo

int main() {
	vector<int> l(10);
	while (scan(l[0])) {
		int sum = l[0];
		for_each(l.begin() + 1, l.end(), [&](int &n) {sum += in(), n = sum;});
		int v1 = in(), vl = in() + v1, pos = v1 * sum;
		int i = 1;
		for (int n: l) {
			if (pos - n * vl <= 0) {
				out(i, '\n');
				break;
			}
			i++;
		}
	}
}

C++: #include<iostream>
using namespace std;
int main(){
	int space[10],sum;
	char dummy;
	while(cin>>space[0]){
		sum=space[0];
		for(int i=1;i<10;++i){
			cin>>dummy>>space[i];
			sum+=space[i];
		}
		int speed1,speed2;
		cin>>dummy>>speed1>>dummy>>speed2;
		double time,distance;
		time=(double)sum/(speed1+speed2);
		distance=speed1*time;
		int answer;
		for(answer=0;distance>0.0;distance-=space[answer++]);
		cout<<answer<<endl;
	}
	return 0;
}

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

#define N 10	// üHÌ

int main()
{
	double l[N], v[2];
	double sum[N];
	double position;
	int i;

	while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&l[0],&l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&v[0],&v[1]) != EOF) {
		sum[0] = l[0];
		for (i = 1; i < N; i++)
			sum[i] = sum[i-1]+l[i];
		position = v[0] * sum[9] / (v[0]+v[1]);
		for (i = 0; i < N; i++)
			if (sum[i]>=position)
				break;
		i++;

		cout<<i<<endl;
	}

	return 0;
}

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

using namespace std;

int main(){
  int i;
  double closs, l[10], v[2], sum_len = 0.0;
  double sum_time[2]={};
  double t[2][10]={};
  while(scanf("%lf,",&l[0])!=EOF){
    sum_len=l[0];
    for(i=1;i<10;i++) {scanf("%lf,",&l[i]);sum_len+=l[i];}
    scanf("%lf,%lf",&v[0],&v[1]);
    closs=1.0*sum_len/(1.0*(v[0]+v[1]));
    sum_time[0] = 0.0;
    sum_time[1] = 0.0;
    for(i=0;i<10;i++){
      t[0][i]=sum_time[0]+(l[i]/v[0]);
      t[1][9-i]=sum_time[1]+l[9-i]/v[1];
      sum_time[0]+=l[i]/v[0];
      sum_time[1]+=l[9-i]/v[1];
      // cout<<l[i]/v[0] <<' ';
    }
    for(i=0;i<10;i++){
      //cout<<t[0][i] << ' ' <<t[1][i] <<endl;
      if(t[0][i] >= closs && t[1][i] <= closs) {cout<<i<<endl; break;}
      // if(t[0][i] == t[1][i] && t[0][i] == closs) {cout<<i+1<<endl; break;}
    }
  }
  return 0;
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  vi l(10);
  while (cin >> l[0]) {
    char gomi;
    cin >> gomi;
    loop(i, 1, 10) cin >> l[i] >> gomi;
    int u, v;
    cin >> u >> gomi >> v;
    int s    = accumulate(all(l), 0);
    double x = double(s) * u / (u + v);
    rep(i, 10) {
      x -= l[i];
      if (x <= 0) {
        cout << i + 1 << endl;
        break;
      }
    }
  }
}

C++: #include<iostream>
using namespace std;
int main(){
  char g;
  double len[11],total=0;
  double train1,train2;
  double a;
  while(1){
    total=0;
  for(int i=0;i<10;i++){
    cin >> len[i] >> g;
    total+=len[i];
  }
  cin >> train1 >> g >> train2;
  if(cin.eof()) break;
  a=total/(train1+train2);
  a*=train1;
  total=0;
  int i=0;
  while(a>total){
    total+=len[i];
    i++;
  }
  cout << i << endl;
  }
}

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

int d[10];

int solve(double x){
  int i,sum=d[0];
  for(i=1; i<10; i++){
    if(x<=sum)break;
    sum+=d[i];
  }
  return i;
}

int main(){
  char t;
  int v1, v2;
  while(cin>>d[0]>>t){
    int len=d[0];
    for(int i=1; i<10; i++){cin>>d[i]>>t; len+=d[i];}
    cin>>v1>>t>>v2;
    double time=((double)len/(double)(v1+v2));
    cout<<solve(v1*time)<<endl;
  }
  return 0;
}

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

int main() {
	int l[10],v1,v2;
	int len;
	float len1,len2;
	
	
	while(len=0,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)+1){
		for(int i=0;i<10;++i)len+=l[i];
		
		len1=0;
		len2=len;
		
		while(fabs(len1 - len2) > 0.5 ){
			len1 += 0.01f * v1;
			len2 -= 0.01f * v2;
		}
		
		len2=0;
		for(int i=0;i<9;++i){
			if(len1 >= len2 && len1 <len2+l[i]){
				cout<<i+1<<endl;
				break;
			}
			len2+=l[i];
		}
		
	}
	
	return 0;
}

C++: #include<iostream>
int main()
{
	while (true)
	{
		double l[10];
		double length = 0;
		char foo;
		for (int i = 0; i < 10; i++)
		{
			std::cin >> l[i] >> foo;
			length += l[i];
		}
		double v1, v2;
		std::cin >> v1 >> foo >> v2;
		if (std::cin.eof())
		{
			break;
		}
		double meetpoint = length * v1 / (v1 + v2);
		length = 0;
		for (int i = 0; i < 10; i++)
		{
			length += l[i];
			if (length >= meetpoint)
			{
				std::cout << i + 1 << std::endl;
				break;
			}
		}
	}
	return 0;
}