{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e\u003cb\u003eIt is preferrable to read the pdf statment.\u003c/b\u003e\u003cbr\u003e\u003cbr\u003eCuber QQ and Little Fang are playing a game, called Gaming of Co-prime Disallowance (GCD).\u003cbr\u003e\u003cbr\u003eTo play GCD, two tables are needed. The game starts with $n$ cards on one table, and players take turns to move the cards to another table. In each turn, a player has to select one and only one card and move it. Let\u0027s assume that the players have moved $k$ cards, and there are $n-k$ cards left. The players who cannot make a move any more loses the game.\u003cbr\u003e\u003cbr\u003eIf one of the following two conditions happen, the players can no longer make a move:\u003cbr\u003e\u003cbr\u003e\u003cul\u003e\u003cbr\u003e\u003cli\u003e There is no card on the original table, i.e., $k\u003dn$.\u003c/li\u003e\u003cbr\u003e\u003cli\u003e On each card, there is a number. If the $k$ cards that have been moved have \u003ca href\u003d\"http://https//en.wikipedia.org/wiki/Greatest_common_divisor\"\u003eGreatest Common Divisor (GCD)\u003c/a\u003e equals 1, i.e., the $k$ numbers are co-prime, the game is over and the player who has made the last valid move wins the game.\u003c/li\u003e\u003cbr\u003e\u003c/ul\u003e\u003cbr\u003e\u003cbr\u003eTo test the fairness of GCD, Cuber QQ and Little Fang plays completely randomly without any strategy at all. Help him calculate how likely he is going to win if Cuber QQ plays first.\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line of the input contains a single integer $T$ ($1\\le T\\le 150$), denoting the number of test cases.\u003cbr\u003e\u003cbr\u003eEach of the next $T$ cases:\u003cbr\u003e\u003cbr\u003e\u003cul\u003e\u003cbr\u003e\u003cli\u003e The first line contains an integer $n$ ($2\\le n\\le 100$).\u003c/li\u003e\u003cbr\u003e\u003cli\u003e The second line contains $n$ space-separated numbers $a_1,a_2,\\cdots a_n$ ($1\\le a_i\\le 10^5$), the number on $n$ cards, respectively.\u003c/li\u003e\u003cbr\u003e\u003c/ul\u003e\u003cbr\u003e\u003cbr\u003eIt is guaranteed that $\\sum n \\le 8~000$."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output one line contains a real number --- the probability that Cuber QQ will win the game.\u003cbr\u003e\u003cbr\u003eYour answer is considered correct if its absolute or relative error does not exceed $10^{-6}$.\u003cbr\u003e\u003cbr\u003e\u003cdiv style\u003d\"font-family:Times New Roman;font-size:14px;background-color:F4FBFF;border:#B7CBFF 1px dashed;padding:6px\"\u003e\u003cdiv style\u003d\"font-family:Arial;font-weight:bold;color:#7CA9ED;border-bottom:#B7CBFF 1px dashed\"\u003e\u003ci\u003eHint\u003c/i\u003e\u003c/div\u003e\u003cbr\u003eFor the first sample:\u003cbr\u003e\u003cbr\u003eCuber QQ will win if the players take turns to select the number in this way : $2,1$ ; $2,3$ ; $3,1$ ; $3,2$; $3,4$ ;$4,1$ ; $4,3$\u003cbr\u003e\u003cbr\u003eSo the probability that Cuber QQ will win the game is $\\frac{1}{4}\\cdot \\frac{1}{3}\\times 4+\\frac{1}{4}\u003d\\frac{7}{12}$\u003cbr\u003e\u003c/div\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n4\r\n1 2 3 4\r\n4\r\n1 2 4 8\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0.583333333\r\n0.500000000\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}