import std.algorithm, std.array, std.container, std.range; import std.string, std.conv; import std.math, std.bigint, std.bitmanip, std.random; import std.stdio, std.typecons; alias Tuple!(real, "x", real, "y") point; void main() { auto t = readln.chomp.to!int; foreach (_; 0..t) { readln; auto pi = iota(6).map!((_) { auto rd = readln.split.map!(to!real); return point(rd[0], rd[1]); }); auto ri = pi .map!(p => atan2(p.y, p.x) / PI * 180 + 1e-07) .map!(x => x < 0 ? x + 360 : x) .array; ri.sort(); writefln("%f", ri.front); } }