import java.io.*; import java.math.*; import java.util.*; class U { static boolean debug = false; static void out(String s) { System.out.println(s); } static void out_(String s) { System.out.print(s); } static void d(String s) { if (debug) out(s); } static void d_(String s) { if (debug) out_(s); } static void azzert(boolean b) { if (!b) throw new RuntimeException(); } } public class I { public static void main(String[] args) { Scanner console = new Scanner(System.in); int P = console.nextInt(); for (int p=0; p < P; p++) { U.d(""); int K = console.nextInt(); int numStones = console.nextInt(); int numRings = console.nextInt(); double b = (Math.PI - 2*Math.PI / numStones) / 2; double ringOneRadius = Math.cos(b) / (1 - Math.cos(b)); double finalRingRadius; U.d("ring one radius: " + ringOneRadius); if (numRings == 1) { finalRingRadius = ringOneRadius; } else { finalRingRadius = ringOneRadius * Math.pow(binarySearch(1.0, numStones), numRings-1); } //U.d("b:" + b * 180 / Math.PI); double fenceLength = numStones * 2 * finalRingRadius + 2 * Math.PI * finalRingRadius; U.out(K + " " + finalRingRadius + " " + fenceLength); } } public static double binarySearch(double r, int numStones) { double low = r; double high = 1000*r; double target = Math.PI + 2 * Math.PI / numStones; U.d("starting low: " + low); U.d("starting high: " + high); // run for 1000 steps for (int i = 0; i<1000; i++) { double mid = (low + high) / 2.0; double a = 2 * Math.asin(mid / (mid + r)); double b = Math.acos(r / (mid + r)); if (a + 2*b > target) { high = mid; } else { low = mid; } } U.d("low: " + low); U.d("high: " + high); return (low + high) / 2.0; } } // factor is 2.2366198861832047 when numStones is 7 // factor is 1.6512360672173645 when numStones is 11