{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\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 type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eA straight is a poker hand containing five cards of sequential rank, not necessarily to be the same suit. For example, a hand containing 7 club, 6 spade, 5 spade, 4 heart and 3 diamond forms a straight. In this problem, we extend the definition of a straight to allow \u003cspan class\u003d\"tex-span\"\u003e3\u003c/span\u003e to \u003cspan class\u003d\"tex-span\"\u003e5\u003c/span\u003e cards of sequential rank. Hence a hand containing K spade, Q club, and J heart is also a straight.\u003c/p\u003e\u003cp\u003eMr. Panda is playing a poker game called Straight Master. The game uses a large deck of card that has \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eN\u003c/i\u003e\u003c/span\u003e ranks from \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003e to \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eN\u003c/i\u003e\u003c/span\u003e. The rule of the game is simple: split the cards in Mr. Panda\u0027s hand into several straights of length from \u003cspan class\u003d\"tex-span\"\u003e3\u003c/span\u003e to \u003cspan class\u003d\"tex-span\"\u003e5\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eNow given a hand of cards, can you help Mr. Panda to determine if it is possible to split the cards into straights?\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the input gives the number of test cases, \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eT\u003c/i\u003e\u003c/span\u003e. \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eT\u003c/i\u003e\u003c/span\u003e test cases follow.\u003c/p\u003e\u003cp\u003eEach test case contains two lines. The first line contains an integer \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eN\u003c/i\u003e\u003c/span\u003e, indicating the number of ranks in the deck. The next line contains \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eN\u003c/i\u003e\u003c/span\u003e integers \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e1\u003c/sub\u003e, \u003ci\u003ea\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e2\u003c/sub\u003e, ..., \u003ci\u003ea\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003eN\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e indicating the number of cards for each rank in Mr. Panda\u0027s hand.\u003c/p\u003e\u003cul\u003e \u003cli\u003e \u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003eT\u003c/i\u003e ≤ 100\u003c/span\u003e. \u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003eN\u003c/i\u003e ≤ 2 × 10\u003csup class\u003d\"upper-index\"\u003e5\u003c/sup\u003e\u003c/span\u003e. \u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-span\"\u003e0 ≤ \u003ci\u003ea\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e ≤ 10\u003csup class\u003d\"upper-index\"\u003e9\u003c/sup\u003e\u003c/span\u003e. \u003c/li\u003e\u003cli\u003e \u003cimg align\u003d\"middle\" class\u003d\"tex-formula\" src\u003d\"CDN_BASE_URL/0074e1128840d8aae251bfd7eaa8289b?v\u003d1716203726\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e. \u003c/li\u003e\u003c/ul\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, output one line containing \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eCase #x: y\u003c/span\u003e\", where \u003cspan class\u003d\"tex-font-style-tt\"\u003ex\u003c/span\u003e is the test case number (starting from \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003e) and \u003cspan class\u003d\"tex-font-style-tt\"\u003ey\u003c/span\u003e is \u003cspan class\u003d\"tex-font-style-tt\"\u003eYes\u003c/span\u003e if Mr. Panda can split all his cards into straights of length from \u003cspan class\u003d\"tex-span\"\u003e3\u003c/span\u003e to \u003cspan class\u003d\"tex-span\"\u003e5\u003c/span\u003e, or \u003cspan class\u003d\"tex-font-style-tt\"\u003eNo\u003c/span\u003e otherwise.\u003c/p\u003e"}},{"title":"Examples","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\n13\n1 2 2 1 0 0 0 0 0 0 0 0 0\n13\n1 1 1 1 0 1 1 0 0 0 0 0 0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase #1: Yes\nCase #2: No\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first test case, Mr. Panda can split his cards into two straights: \u003cspan class\u003d\"tex-span\"\u003e[1, 2, 3]\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e[2, 3, 4]\u003c/span\u003e. In the second test case, there is no way to form a straight for card \u003cspan class\u003d\"tex-span\"\u003e6\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e7\u003c/span\u003e.\u003c/p\u003e"}}]}