using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[] NMi => ReadLine().Split().Select(c => int.Parse(c) - 1).ToArray(); static int[][] NMap(int n) => Enumerable.Repeat(0, n).Select(_ => NMi).ToArray(); public static void Main() { Solve(); } static void Solve() { var t = NN; var ans = new double[t]; var pcount = new int[100_001]; var plist = GetMinPDivList(100_001); for (var i = 1; i < pcount.Length; ++i) pcount[i] = pcount[i - 1] + (i > 1 && plist[i] == i ? 1 : 0); for (var u = 0; u < t; ++u) { var c = NList; var (n, p, q) = (c[0], c[1], c[2]); var np = pcount[n] * p; var nnp = (n - pcount[n]) * (100 - q); ans[u] = (double)np / (np + nnp); } WriteLine(string.Join("\n", ans)); } static int[] GetMinPDivList(int max) { var minPDivList = new int[max + 1]; for (var i = 0; i <= max; ++i) minPDivList[i] = i; for (var i = 2; i * i <= max; ++i) if (minPDivList[i] == i) { for (var j = i * i; j <= max; j += i) if (minPDivList[j] == j) { minPDivList[j] = i; } } return minPDivList; } }