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;

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define rrev(i, m, n) for(int (i)=(n)-1; (i)>=(m); (i)--)
#define erev(i, m, n) for(int (i)=(n); (i)>=(m); (i)--)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define mp            make_pair
#define pb            push_back
template<class T, class S> inline bool minup(T& m, S x){ return m>(T)x ? (m=(T)x, true) : false; }
template<class T, class S> inline bool maxup(T& m, S x){ return m<(T)x ? (m=(T)x, true) : false; }

const double INF = 1000000000;
const ll     MOD = 1000000007LL;
const double EPS = 1E-12;

template<typename T> T add(T x, T y){ if(abs(x+y) < EPS*(abs(x)+abs(y))) return 0; return x + y; }
template<typename T> inline bool semieq(T x, T y){ return abs(x - y) < EPS; }
template<typename T> inline bool semige(T x, T y){ return y - x < -EPS; }
template<typename T> inline bool semile(T x, T y){ return x - y < -EPS; }

const int MAX_N = 10;
const int n = MAX_N;
double x[MAX_N+1];
double v[2];

int main()
{
  while(~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], &v[0], &v[1])){
    double len = 0.0;
    rep(i, n) len += x[i];
    double left  = 0.0;
    double right = INF;
    double t;
    while(semile(left, right)){
      t = (left + right) / 2.0;
      if((v[0] + v[1]) * t > len) right = t;
      else left = t;
    }
    rep(i, n-1) x[i+1] += x[i];
    cout << upper_bound(x, x+n, v[0] * t) - x + 1<< endl;
  }

  return 0;
}

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

#define EPS 10e-8

int main(void){
  int s[10], v[2];
  while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",s,s+1,s+2,s+3,s+4,s+5,s+6,s+7,s+8,s+9,v,v+1) != EOF){
    for(int i = 1; i < 10; i++) s[i] += s[i-1];
    double x = (1.0 * v[0] * s[9]) / (v[0] + v[1]);
    for(int i = 0; i < 10; i++){
      if(x <= s[i] + EPS){
        cout << i + 1 << endl;
        break;
      }
    }
  }
  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=(v1)/(v1+v2);
x=x*t;
for(i=0;x>0;i++){
x-=a[i];
}
printf("%d\n",i+1);
}
return 0;
}

C++: // includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a); i<(b);++i)
#define rep(i, n) FOR(i, 0, n)

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
typedef pair<double, double> Pd;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

// solve

int main(int argc, char const* argv[])
{
  string s;
  int l[12];
  while(cin >> s){
    s += ",";
    string tmp = "";
    int ati = 0;
    rep(i, s.size()){
      if(s[i] == ','){
        l[ati] = stoi(tmp);
        ati++;
        tmp = "";
      }else{
        tmp += s[i];
      }
    }
    double lsum = 0.;
    rep(i, 10)lsum += (double)l[i];
    double h = lsum / (double)(l[10] + l[11]);
    h = h * (double)l[10];
    double at = 0.;
    rep(i, 10){
      if(at <= h && h <= at + l[i]){
        cout << i+1 << endl;
        break;
      }
      at += l[i];
    }
  }
	return 0;
}

C++: #include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include <iomanip>
#include <string>
#include <queue>
#include <algorithm>
#include <cctype>
#define shosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const double pi=acos(-1);

int a,v1,v2,ans;
char t;
vi l(10);

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

C++: #include<cstdio>
int main(){
    double l[10],v1,v2;
    while(~scanf("%lf,",&l[0])){
        for(int i=1;i<10;i++){
            scanf("%lf,",&l[i]);
        }
        scanf("%lf,%lf",&v1,&v2);
        double cs;
        for(int i=1;i<10;i++){
            l[i]+=l[i-1];
        }
        cs=(l[9]/(v1+v2))*v1;
        for(int i=0;i<10;i++){
            if(cs<=l[i]){
                printf("%d\n",i+1);
                break;
            }
        }
    }
}

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

using namespace std;

int main(int argc, char *argv[]) {
  double d[10], v1, v2;
  vector<int> result;
  while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,\n",
               d, d+1, d+2, d+3, d+4, d+5, d+6, d+7, d+8, d+9, &v1, &v2) != EOF) {
    double hoge = 0;
    for (int i = 0; i < 10; i++)
      hoge += d[i];
    hoge /= v1 + v2;
    hoge *= v1;
    double piyo = 0;
    bool passed = false;
    for (int i = 0; i < 10; i++)
      if (hoge <= piyo) {
        result.push_back(i);
        passed = true;
        break;
      } else {
        piyo += d[i];
      }
    if (!passed)
      result.push_back(9);
  }

  for (int i = 0; i < result.size(); i++)
    cout << result[i] << endl;
  return 0;
}

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

int main() {
	ios_base::sync_with_stdio( false );

	const int n = 11; // station num
	vector<int> st( n );
	int v1, v2;

	string line;
	while( getline( cin, line ) ) {
		for( auto& c: line ) {
			if( c == ',' ) { c = ' '; }
		}

		istringstream iss( line );

		for( int i = 1; i < n; ++i ) {
			iss >> st[i];
			st[i] += st[i-1];
		}
		iss >> v1 >> v2;

		double a = st.back() * ((double)v1 / (v1+v2));
		for( int i = 1; i < n; ++i ) {
			if( st[i] >= a ) {
				cout << i << '\n';
				break;
			}
		}
	}

	return 0;
}

C++: #include<cstdio>
#include<iostream>
using namespace std;
int main(){
	int a[10];
	int v1,v2;
	while(scanf("%d",a)!=EOF){
		for(int i=1;i<10;i++){
			scanf(",%d",&a[i]);
			a[i] += a[i-1];
		}
		scanf(",%d,%d\n",&v1,&v2);
		int ans;
		for(int i=9;i>=0;i--){
			if(v1*a[9] <= a[i]*(v1+v2))ans=i;
		}
		cout<<ans+1<<endl;
	}
	return 0;
}