>>52
やってみた。

upper_limit = 1.5 * ave
lower_limit = 0.5 * ave
n_upper = n_middle = n_lower = 0
best_shipment = worst_shipment = 0
best_month = worst_month = 0
(1..n).each do |month|
 shipment = shipments[month-1]
 if shipment >= upper_limit
  n_upper += 1
 elsif shipment < lower_limit
  n_lower += 1
 else
  n_middle += 1
 end
 if shipment > best_shipment
  best_shipment, best_month = shipment, month
 elsif shipment < worst_shipment
  worst_shipment, worst_month = shipment, month
 end
end

でもさ、学校の宿題を自力で解こうとせず、2chに丸投げなんて、人生やめたほうがいいよ。