lib C fun strtoll(s : UInt8*, p : UInt8**, b : Int32) : Int64 end class String def to_i64 C.strtoll(self, nil, 10) end end read_line.to_i.times do read_line xy = (1..6).map { read_line.split.map(&.to_f) } printf "%.12f\n", xy.map { |i| Math.atan2(i[1], i[0]) * 180 / Math::PI }.select { |d| -1e-10 <= d < 50 + 1e-10 }.[0] end