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 <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#include <cctype>
#include <cstdio>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define INF (2 << 28)
#define fr first
#define sc second

using namespace std;

typedef long long ll;
typedef pair<int, int> iP;

typedef pair<double, double> dP;

int main(){
  
  string line;
  int l[10];
  
  while(~scanf("%d,", l)){
    int v1, v2;
    vector <dP> t1(10);
    vector <dP> t2(10);
    int l1[10] = {}, l2[10] = {};
    
    for(int i = 1; i < 10; i++) 
      scanf("%d,", l + i);
    scanf("%d,%d", &v1, &v2);
    
    for(int i = 1; i < 10; i++){
      l1[i] += l1[i - 1] + l[i];
      l2[9 - i] += l2[9 - i + 1] + l[9 - i];
    }
    l1[0] = l[0], l2[9] = l[9];
     
    double begin = 0;
    for(int i = 0; i < 10; i++){
      t1[i].fr = begin;
      t1[i].sc = (double)l1[i] / v1;
      begin = (double)l1[i] / v1;
    }

    begin = 0;
    for(int i = 9; i >= 0; i--){
      t2[i].fr = begin;
      t2[i].sc = (double)l2[i] / v2;
      begin = (double)l2[i] / v2;
    }

    for(int i = 0; i < 10; i++){
      if(!(t1[i].fr >= t2[i].sc || t2[i].fr >= t1[i].sc)){
        if(fabs(t1[i].sc - t2[i].fr) <= 1e-2 || fabs(t1[i].fr - t2[i].sc) <= 1e-2) cout << i << endl;
        else cout << i + 1 << endl;
        break;
      }
    }
  }
}

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

int main() {
    int l[10], v1, v2;
    char c;
    while (cin >> l[0]) {
        int sum = l[0];
        for (int i=1; i<10; ++i) {
            cin >> c >> l[i];
            sum += l[i];
        }
        cin >> c >> v1 >> c >> v2;

        int d = 0;
        for (int i=0; i<10; ++i) {
            d += l[i];
            if (v1 * sum <= d * (v1 + v2)) {
                cout << i + 1 << endl;
                break;
            }
        }
    }
    return 0;
}

C++: #include <iostream>
#include <array>
#include <numeric>
#include <cstdint>

int main()
{
	std::array<std::uint32_t, 10> length;
	while (std::cin >> length[0]) {
		char comma;
		for (std::uint32_t i = 1; i < length.size(); ++i) {
			std::cin >> comma >> length[i];
		}
		double v1, v2;
		std::cin >> comma >> v1 >> comma >> v2;

		std::uint32_t const total_len = std::accumulate(length.begin(), length.end(), 0u);
		double const pos = v1 * total_len / (v1 + v2);

		std::uint32_t len = 0u;
		for (std::uint32_t i = 0; i < length.size(); ++i) {
			len += length[i];
			if (pos <= len) {
				std::cout << i + 1 << std::endl;
				break;
			}
		}
	}

	return 0;
}

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

int main(){
  double v1,v2;
  int l[10];
  while(~scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%lf,%lf",&l[0],&l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&v1,&v2)){
  double sum = 0;
  rep(i,10){
    sum += l[i];
  }
  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>
#include<cstdio>

int main(){
  int l[11];
  int v1,v2,sum;
  int x;

  //std::cout << (int)(5/2+0.51) <<std::endl;

  while(std::cin >> l[1]){
    sum = l[1];
    for(int i=2;i<11;i++){
      std::scanf(",%d",&l[i]);
      sum += l[i];
    }
    std::scanf(",%d,%d",&v1,&v2);
    if((sum*v1)%(v1+v2)==0){
      x = (sum*v1)/(v1+v2);
    }else{
      x = (sum*v1)/(v1+v2);
      ++x;
    }
    sum = 0;
    for(int i=1;i<11;i++){
      sum += l[i];
      if(x<=sum){
        std::cout << i << std::endl;
        break;
      }
    }
  }
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<map>
#include<numeric>

using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl

#define rep(i,n) for(int i = 0; i < (n);++i)
#define repc(i,a,b) for(int i = (a);i <(b);++i)
#define repa(n,array) for(auto n :(array))

typedef long long ll ;
typedef vector<int> vi ;
typedef vector<ll> vl ;

constexpr int IMAX = ((1<<30)-1)*2+1 ;
constexpr int INF = 100000000;
double EPS = 1e-10 ;

template <typename T>
T out(vector < T > v)
{
  for(size_t i = 0; i < v.size(); i++)
  {
    debug(v[i]);
  }
  return 0 ;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  double v1,v2,l1 = 0,l2,ans;
  char c;
  vi v(10,0) ;
  while(cin >> v[0] >> c){
    l1 = 0;
    repc(i,1,10){
      cin >> v[i] >> c;
    }
    cin >> v1 >> c>>v2;
    l2 = accumulate(all(v),0) ;
    v1 = v1/3600;
    v2 = v2/3600;
    while(l1<l2){
      l1 += v1 ;
      l2 -= v2 ;
    }
    ans = 0 ;
    rep(i,10){
      if(l1 == ans){
        debug(ans) ;
        ans = i ;
        break ;
      }
      if(l1 < ans){
        debug(ans) ;
        ans = i ;
        break;
      }
      ans += v[i];
    }
    cout << ans << endl;
  }
  return 0;
}

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

int main(){
  int a[12]={0},v1,v2;
  char s;
  double l;
  while(cin >>a[1]>>s>>a[2]>>s>>a[3]>>s>>a[4]>>s>>a[5]>>s>>a[6]>>s>>a[7]>>s>>a[8]>>s>>a[9]>>s>>a[10]>>s>>v1>>s>>v2){
    for(int i=1;i<=10;i++)a[i]+=a[i-1];
    l=(double) a[10]*(double) v1/( (double) v1+(double) v2);
    for(int i=1;i<=10;i++){
      if(a[i]>=l){
	cout<<i<<endl;
	break;
      }
    }
  }
  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( 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 <cstdio>
#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){
    scanf("%d,",&l[i]);
    sum += l[i];
  }
  scanf("%lf,%lf",&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;
}