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 <sstream>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cctype>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(c,i) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

int solve(int a[],int v[])
{
	int sum=accumulate(a,a+10,0);
	int s=0;
	rep(i,10){
		s+=a[i];
		if(v[1]*s>=v[0]*(sum-s))
			return i+1;
	}
	return 10;
}

int main()
{
	for(int a[10],v[2];cin>>a[0];){
		repi(i,1,10)
			scanf(",%d",a+i);
		rep(i,2)
			scanf(",%d",v+i);
		cout<<solve(a,v)<<endl;
	}
	
	return 0;
}

C++: #include <iostream>
#define  rep(i,n) for(int i = 0 ; i < n ; i++ )
using namespace std;

int main(){
  double v1,v2;
  int l[10];
  double sum = 0;
  rep(i,10){
    cin >> l[i];
    sum += l[i];
  }
  cin >> v1 >> v2;
  double sum2 = 0;
  v1=(v1/(v1+v2))*sum;

  rep(i,10){
    sum2+=l[i];
    if(v1 <= sum2){
      cout << i+1 << endl;
      break;
    }
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
         
    int km[10],v1,v2; char a;
    double leng;
    while(1){
       for(int i = 0; i < 10; i++)
                cin >> km[i] >> a;
         
        if(!cin)    break;
        cin >> v1 >> a >> v2;
  
    leng = 0.0;
    for(int k =0;k<10;k++)
    leng += km[k];
    double length = leng * v1 / (v1 +v2);
    leng = 0.0; 
    for(int k=0;k<10;k++){
    leng +=  km[k];
    if(leng >= length ){
     
    cout << k+1 <<endl; break;
    }
    }  
    }
}

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

int main(){
	int l[10], v1, v2, suml, i;
	double t, cross;
	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){
		suml = 0;
		for(i=0;i<10;i++){
			suml += l[i];
		}
		t = suml / double(v1+v2);
		cross = t*v1;
		suml = 0;
		for(i=0;suml<cross;i++){
			suml += l[i];
		}
		cout << i << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
 
#define REP(i,b,n) for(int i=b;i<n;++i)
#define REPR(i,b,n) for(int i=n-1;i>=b;--i)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define NCLR(mat) memset(mat, -1, sizeof(mat))
#define EACH(i, c) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define BIT(n, b) ((n>>b) & 1)
#define PI acos(-1.0)

using namespace std;

static const double EPS = 1e-9;
typedef pair<int, int> pii;
typedef long long ll;

double l[11]={0}, v1, v2;

int solve(){
	
	double r = v1/(v1+v2);
	double x = r*l[10];
	
	for(int i=1; i <= 10; ++i){
		if( l[i-1] < x && x <= l[i] )
			return i;
	}
	
	return 10;
}
	

int main(){
		
	while(!cin.eof()){
		
		char c;
		
		for(int i=1; i<=10; ++i){
		
			cin >> l[i] >> c;
			l[i]+=l[i-1];
		}
		
		cin >> v1 >> c >> v2; 
		
		cout << solve() << endl;
	}
		
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <sstream>

std::vector<std::string> split(std::string &str, char delim) {
	std::vector<std::string> result;
	std::istringstream is(str);
	std::string buf;
	while (getline(is, buf, delim)) {
		result.push_back(buf);
	}
	return result;
}

bool inputDataSet(std::vector<int> *l, int *v1, int *v2) {
	std::string line;
	if (!getline(std::cin, line)) { return false; }
	std::vector<std::string> tokens = split(line, ',');
	if (tokens.size() != 12) { return false; }
	for (int i = 0; i < 10; ++i) {
		std::istringstream is(tokens[i]);
		if (!(is >> (*l)[i])) { return false; }
	}
	std::istringstream is1(tokens[10]), is2(tokens[11]);
	if (!((is1 >> *v1) && (is2 >> *v2))) { return false; }
	return true;
}

template <class Iterator>
int sum(Iterator first, Iterator last) {
	int sum = 0;
	for (; first != last; ++first) { sum += *first; }
	return sum;
}

int main() {
	std::vector<int> l(10);
	int v1, v2;
	while (inputDataSet(&l, &v1, &v2)) {
		const int x1 = 0, x2 = sum(l.begin(), l.end());
		v2 = -v2;
		if (v1 == v2) { continue; }	// ツ堕環妥篠堕ャツ度 0 ツづ按づァツ古ーツ債キツつオツづ按つ「
		const double x = static_cast<double>(x1) + static_cast<double>(-(x1 - x2) * v1) / static_cast<double>(v1 - v2);	// ツ渉ャツ青板つェツ静伉偲個づつウツづェツづゥツづ債「ツづゥ
		int n = 0, sum = 0;
		for (std::vector<int>::iterator it = l.begin(); it != l.end() && static_cast<double>(sum) < x; ++it) {
			sum += *it;
			++n;
		}
		std::cout << n << std::endl;
	}
	return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<vector>
#include<queue>
#include<list>
#include<stack>
#include<algorithm>
#include<cmath>
#include<memory>
#include<array>

using namespace std;

int main()
{
  array<double, 10> l;
  double v1, v2;
  char c;

  while ( cin >> l[0] )
    {
      double al = l[0];

      for ( auto i = 1; i < 10; ++i )
        {
          cin >> c >> l[i];
          al += l[i];
        }
  
      cin >> c >> v1 >> c >> v2;

      double p = al * v1 / (v1 + v2);

      double cl = 0;

      for ( auto i = 0; i < 10; ++i )
        {
          cl += l[i];
          if ( cl >= p )
            {
              cout << i + 1 << endl;
              break;
            }
        }
    }
  
  return 0;
}

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

int main()
{

int num[11]={};
int x,t,T=0;
double S1=0,S2=0,V1,V2,W;
bool f1=false,f2=false;
while(scanf("%d %d %d %d %d %d %d %d %d %d %lf %lf",&num[0],&num[1],&num[2],&num[3],&num[4],&num[5],&num[6],&num[7],&num[8],&num[9],&V1,&V2)!=EOF){
/*
for(int i=1;i<10;i++)
{scanf("%d",&x);num[i]=x;}
cin>>V1>>V2;
*/
for(int i=0;i<10;i++)
S1+=num[i];
for(int i=0;i<10;i++)
S2=V1+V2;
t=0;
W=S1*V1/S2;

do{

T+=num[t];
if(T==W)f1=true;
t++;
}while(T<W);
if(f1==false)printf("%d\n",t);
else if(f1==true)printf("%d\n",t);
}
return 0;
}

C++: import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main{
	public static void main(String[] args)throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		String str;
		
		while((str = reader.readLine()) != null){
			String[] code = str.split(",",0);
			int sum = 0;
			
			int[] station = new int[12];
			for(int i = 0; i < 10; i++){
				station[i] = Integer.parseInt(code[i]);
				sum += station[i];
			}
			int v1 = Integer.parseInt(code[10]);
			int v2 = Integer.parseInt(code[11]);
			double x = 0,s = 0;
			for(int i = 0; i < 10; i++){
				x += station[i];
				s = x / v1;
				if(x + s * v2 >= sum){
					System.out.println(i + 1);
					break;
				}
				}
			}
		reader.close();
	}
}