# Код на ruby 2.2.3p173
def zadanie(results)
k = 1
for i in 0..results.size-1
results[i] = [i+1,results[i]]
end
results = results.sort_by{|v| v[1]}
results = results.reverse
return [results[0][0], results[1][0]]
end
# Примеры применения
p zadanie([1,2,7,8,6,4,8,8,4,9])
p zadanie([47,23,50,12,23,15,40,46,15,49])