{"problem":{"name":"False Hope","description":{"content":"There is a $3\\times3$ grid with numbers between $1$ and $9$, inclusive, written in each square. The square at the $i$\\-th row from the top and $j$\\-th column from the left $(1\\leq i\\leq3,1\\leq j\\leq3)","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc319_c"},"statements":[{"statement_type":"Markdown","content":"There is a $3\\times3$ grid with numbers between $1$ and $9$, inclusive, written in each square. The square at the $i$\\-th row from the top and $j$\\-th column from the left $(1\\leq i\\leq3,1\\leq j\\leq3)$ contains the number $c _ {i,j}$.\nThe same number may be written in different squares, but not in three consecutive cells vertically, horizontally, or diagonally. More precisely, it is guaranteed that $c _ {i,j}$ satisfies all of the following conditions.\n\n*   $c _ {i,1}=c _ {i,2}=c _ {i,3}$ does not hold for any $1\\leq i\\leq3$.\n*   $c _ {1,j}=c _ {2,j}=c _ {3,j}$ does not hold for any $1\\leq j\\leq3$.\n*   $c _ {1,1}=c _ {2,2}=c _ {3,3}$ does not hold.\n*   $c _ {3,1}=c _ {2,2}=c _ {1,3}$ does not hold.\n\nTakahashi will see the numbers written in each cell in random order. He will get **disappointed** when there is a line (vertical, horizontal, or diagonal) that satisfies the following condition.\n\n*   The first two squares he sees contain the same number, but the last square contains a different number.\n\nFind the probability that Takahashi sees the numbers in all the squares without getting disappointed.\n\n## Constraints\n\n*   $c _ {i,j}\\in\\lbrace1,2,3,4,5,6,7,8,9\\rbrace\\ (1\\leq i\\leq3,1\\leq j\\leq3)$\n*   $c _ {i,1}=c _ {i,2}=c _ {i,3}$ does not hold for any $1\\leq i\\leq3$.\n*   $c _ {1,j}=c _ {2,j}=c _ {3,j}$ does not hold for any $1\\leq j\\leq3$.\n*   $c _ {1,1}=c _ {2,2}=c _ {3,3}$ does not hold.\n*   $c _ {3,1}=c _ {2,2}=c _ {1,3}$ does not hold.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$c _ {1,1}$ $c _ {1,2}$ $c _ {1,3}$\n$c _ {2,1}$ $c _ {2,2}$ $c _ {2,3}$\n$c _ {3,1}$ $c _ {3,2}$ $c _ {3,3}$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc319_c","tags":[],"sample_group":[["3 1 9\n2 5 6\n2 7 1","0.666666666666666666666666666667\n\nFor example, if Takahashi sees $c _ {3,1}=2,c _ {2,1}=2,c _ {1,1}=3$ in this order, he will get disappointed.\n![image](https://img.atcoder.jp/abc319/d4635a227bbb8db7143f4bbee77a9979.png)\nOn the other hand, if Takahashi sees $c _ {1,1},c _ {1,2},c _ {1,3},c _ {2,1},c _ {2,2},c _ {2,3},c _ {3,1},c _ {3,2},c _ {3,3}$ in this order, he will see all numbers without getting disappointed.\nThe probability that Takahashi sees all the numbers without getting disappointed is $\\dfrac 23$. Your answer will be considered correct if the absolute error from the true value is at most $10 ^ {-8}$, so outputs such as $0.666666657$ and $0.666666676$ would also be accepted."],["7 7 6\n8 6 8\n7 7 6","0.004982363315696649029982363316"],["3 6 7\n1 9 7\n5 7 5","0.4"]],"created_at":"2026-03-03 11:01:14"}}