{"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\"\u003eYou are given a 4 × 4 grid, which consists of 15 number cells and an empty cell.\u003cbr\u003eAll numbers are unique and ranged from 1 to 15.\u003cbr\u003eIn this board, the cells which are adjacent with the empty cell can move to the empty cell.\u003cbr\u003eYour task is to make the input grid to the target grid shown in the figure below.\u003cbr\u003eIn the following example (sample input), you can get the target grid in two moves.\u003cbr\u003e\u003ccenter\u003e\u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/bab6a50f80d3f66166acf77987f7b98e?v\u003d1716192672\"\u003e\u003c/center\u003e \u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line contains an integer T (1 \u0026lt;\u003d T \u0026lt;\u003d 10^5) denoting the number of test cases.\u003cbr\u003eEach test case consists of four lines each containing four space-separated integers, denoting the input grid. 0 indicates the empty cell."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, you have to print the answer in one line.\u003cbr\u003eIf you can’t get the target grid within 120 moves, then print \u0027No\u0027, else print \u0027Yes\u0027."}},{"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\n1 2 3 4\r\n5 6 7 8\r\n9 10 0 12\r\n13 14 11 15\r\n1 2 3 4\r\n5 6 7 8\r\n9 10 11 12\r\n13 15 14 0\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYes\r\nNo\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}