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 <cstdio>

using namespace std;

double l[10];
double v1, v2;

int main()
{
  while (scanf("%lf", &l[0]) == 1) {
    int sum = l[0];
    for (int i = 1; i < 10; i++) {
      scanf(",%lf", &l[i]);
      sum += l[i];
    }
    scanf(",%lf,%lf", &v1, &v2);
    
    double x = (sum * v1) / (v1 + v2);

    int c;
    for (c = 0; x > 0; c++) {
      x -= l[c];
    }
    
    printf("%d\n", c);
  }
  return 0;
}

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	int train[10];
	int v1, v2;
	char c;

	while(cin >> train[0] >> c){
		int sum = 0;
		sum += train[0];
		for(int i = 1; i < 10; ++i){
			cin >> train[i] >> c;
			sum += train[i];
		}

		cin >> v1 >> c >> v2;

		float t = (float)sum / (v1 + v2);
		float l = v1 * t;

		int i = 0;
		while(l > 0){
			l -= train[i];
			++i;
		}

		cout << i << endl;
	}

	return 0;
}

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(){
	double l1, l2, l3, l4, l5, l6, l7, l8, l9, l10;
	double v1, v2;
	char c;
	while(cin >> l1 >> c >> l2 >> c >> l3 >> c >> l4
		>> c >> l5 >> c >> l6 >> c >> l7 >> c >> l8
		>> c >> l9 >> c >> l10 >> c >> v1 >> c >> v2)
	{
		double l[] = {
			0,l1,l2,l3,l4,l5,
			l6,l7,l8,l9,l10
		};
		double max_length = l1 + l2 + l3 + l4 + l5
							+l6 + l7 + l8 + l9 + l10;
		for(int i = 1; i <= 10;i++){
			max_length -= (l[i] + (v2 * l[i] / v1));
			if(max_length <= 0){
				cout << i << endl;
				break;
			}
		}
	}
	return 0;
}

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

int main(){
	int l[10],v1,v2;
	while(scanf("%d",&l[0])!=EOF){
		int dis=l[0];
		for(int i=1;i<10;i++){
			scanf(",%d",&l[i]);
			dis+=l[i];
		}
		scanf(",%d,%d",&v1,&v2);
		double time=(double)dis/(v1+v2);
		double conf=(double)v1*time;
		double len=0.0;
		for(int i=0;i<10;i++){
			len+=l[i];
			if(len>=conf){
				cout<<i+1<<endl;
				break;
			}
		}
	}
	return 0;
}

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

using namespace std;

constexpr int n = 10;
int L[n+2],P[n];
int main(){
  string str;
  while(getline(cin,str)){
    string tmp;
    istringstream stream(str);
    for(int i=0;getline(stream,tmp,',');++i){
      L[i] = stod(tmp);
    }
    P[0] = L[0];
    for(int i=1;i<n;++i) P[i] = P[i-1] + L[i];
    int v1 = L[n],v2 = L[n+1];

    double p = (double)P[n-1]/(v1+v2)*v1;
    
    for(int i=0;i<n;++i){
      if(p<=P[i]){
        cout << i+1 << endl;
        break;
      }
    }

  }
}

C++: #include<stdio.h>
int main(void){
	int l[10],v[2];
	int sv,sl,i;
	double n;
	while(~scanf("%d",l)){
		sv=0;sl=l[0];
		for(i=1;i<=9;i++){
			scanf(",%d",l+i);
			sl+=l[i];
		}
		for(i=0;i<2;i++){
			scanf(",%d",v+i);
			sv+=v[i];
		}
		n=sl/(double)sv;
		n*=v[0];
		for(i=0;n>0;i++)n-=l[i];
		printf("%d\n",i);
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<map>
#include<sstream>
#include<algorithm>
using namespace std;

int main(){
   
   int i,n,sum;
   int f1,f2;
   double a,b,p;
   
   vector<int> kyori;
   stringstream ss;
   string str;
   char s;
   
   while(getline(cin,str)){
      
      kyori.clear();
      sum=0;
      ss<<str;
   
      for(i=0;i<10;i++){
         ss>>n>>s;
         kyori.push_back(n);
      }
      ss>>f1>>s>>f2;
   
      for(i=0;i<10;i++) sum+=kyori[i];
      
      a = f1*sum; b = f1+f2;
      p = a/b;
      
      sum=0;
      for(i=0;i<10;i++){
         if(sum>=p){
            cout<<i<<endl;
            break;
         }
         else
            sum+=kyori[i];
      }
      ss.str("");
      ss.clear(stringstream::goodbit);
   }
   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])){
    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++: #include <iostream>
#include <cstdio>

using namespace std;

int main(void)
{
	double line[10];
	double v1,v2;

	while( scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&line[0],&line[1],&line[2],&line[3],&line[4],&line[5],&line[6],&line[7],&line[8],&line[9],&v1,&v2) ){

		double sum = 0;

		for( int i = 0;i < 10;i++ ){
			sum += line[i];
		}

		double time = sum / ( v1 + v2 );

		double dist = time * v1;


		for( int i = 0;i < 10;i++ ){
			dist -= line[i];

			if( dist <= 0 ){
				cout << i + 1 << endl;
				break;
			}
		}
	}

	return 0;
}