fork download
  1. #今日はもう疲れ切ってしまって思考力が残ってない、一番簡単な問題が転がってたので
  2. #取り合えずそれを無思考で解く
  3. while true do
  4. as=[]
  5. n=gets.to_i
  6. break if n==0
  7. n.times{
  8. as<<gets.split.map{|e| e.to_i}.sum
  9. }
  10. puts [as.max,as.min].join(" ")
  11. end
Success #stdin #stdout 0.01s 6028KB
stdin
3
49 50 87 78 41
27 61 100 45 84
28 88 40 95 66
2
100 100 100 100 100
0 0 0 0 0
1
89 90 85 93 82
0
stdout
317 305
500 0
439 439