$<.each_line do |line|
  src = line.split(",").map(&:to_i)

  lens   = src[0...10]
  v1, v2 = src[10, 11]

  total_len = lens.inject(:+).to_f
  meet_time = total_len / (v1+v2)
  if v1 < v2
    advanced     = 0
    meet_spot    = meet_time * v1
    meet_section = lens.index{|l| advanced += l; advanced >= meet_spot}+1
    puts meet_section
  else
    advanced     = 0
    meet_spot    = meet_time * v2
    meet_section = lens.rindex{|l| advanced += l; advanced >= meet_spot}+1
    puts meet_section
  end
end