t = gets.to_i t.times do gets 6.times do x, y = gets.split.map(&:to_f) deg = Math.atan2(y, x) * 180.0 / Math::PI if deg >= -0.01 && deg <= 50.01 puts deg end end end