import java.io.*; import java.util.*; public class pahom_mb { public static void main(String[] args) throws IOException { try (Input in = new Input()) { int c = in.nextInt(); for (int nc = 0; nc < c; ++nc) { int m = in.nextInt(); int t = in.nextInt(); int maxN = t / m; double best = 0; for (int n = 3; n <= maxN; ++n) { double side = t / 2.0 / n - m / 2.0; double area = n * side * side / Math.tan(Math.PI / n); if (area >= best) { best = area; } else { break; } } System.out.println(best); } } } private static class Input implements Closeable { private final BufferedReader in; private StringTokenizer st; Input() throws IOException { in = new BufferedReader(new InputStreamReader(System.in)); st = new StringTokenizer(in.readLine()); } int nextInt() throws IOException { while (!st.hasMoreTokens()) { st = new StringTokenizer(in.readLine()); } return Integer.parseInt(st.nextToken()); } public void close() throws IOException { in.close(); } } }