{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"\u003ch3\u003eRead problems statements in \u003ca target\u003d\"_blank\" href\u003d\"https://www.codechef.com/download/translated/NOV17/mandarin/CHEFHPAL.pdf\" rel\u003d\"nofollow noreferrer noopener\"\u003eMandarin chinese\u003c/a\u003e, \u003ca target\u003d\"_blank\" href\u003d\"https://www.codechef.com/download/translated/NOV17/russian/CHEFHPAL.pdf\" rel\u003d\"nofollow noreferrer noopener\"\u003eRussian\u003c/a\u003e and \u003ca target\u003d\"_blank\" href\u003d\"https://www.codechef.com/download/translated/NOV17/vietnamese/CHEFHPAL.pdf\" rel\u003d\"nofollow noreferrer noopener\"\u003eVietnamese\u003c/a\u003e as well.\u003c/h3\u003e\n\n\u003cp\u003e\n\tChef\u0027s birthday is coming soon! His friend Fehc is going to send him a string of length \u003cstrong\u003eN\u003c/strong\u003e as a gift. Knowing that Chef doesn\u0027t like palindromes, Fehc wants the longest palindromic substring to be as short as possible. The string should only contain the first \u003cstrong\u003eA\u003c/strong\u003e latin letters(e.g. let \u003cstrong\u003eA\u003c/strong\u003e\u003d2, then this string only contains \u003cspan style\u003d\"font-family:\u0027courier new\u0027, courier, monospace;\"\u003e\u0027a\u0027\u003c/span\u003e and \u003cspan style\u003d\"font-family:\u0027courier new\u0027, courier, monospace;\"\u003e\u0027b\u0027\u003c/span\u003e). Please help Fehc and find such a string. If multiple solution exists, you can print any.\u003c/p\u003e\n\u003ch3\u003e\n\tInput\u003c/h3\u003e\n\u003cul\u003e\u003cli\u003eThe first line of input is an integer \u003cb\u003eT\u003c/b\u003e, denoting the number of test cases.\u003c/li\u003e\n\t\u003cli\u003e\u003cb\u003eT\u003c/b\u003e tests follow. For each test, there is a line containing two space-separated integers \u003cb\u003eN\u003c/b\u003e and \u003cb\u003eA\u003c/b\u003e.\u003c/li\u003e\n\u003c/ul\u003e\u003ch3\u003e\n\tOutput\u003c/h3\u003e\n\u003cp\u003e\n\tFor each test, print a number \u003cstrong\u003eL\u003c/strong\u003e and a string \u003cstrong\u003es\u003c/strong\u003e, separated by one space. \u003cstrong\u003eL\u003c/strong\u003e is equal to the length of longest palindromic substring of \u003cstrong\u003es\u003c/strong\u003e, and \u003cstrong\u003es\u003c/strong\u003e is the string that Fehc will give to Chef. You must minimize \u003cstrong\u003eL\u003c/strong\u003e, but in the case of multiple \u003cstrong\u003es\u003c/strong\u003e\u0027s, any valid \u003cstrong\u003es\u003c/strong\u003e is OK.\u003c/p\u003e\n\u003ch3\u003e\n\tConstraints\u003c/h3\u003e\n\u003cul\u003e\u003cli\u003e\u003cstrong\u003e1\u003c/strong\u003e≤\u003cstrong\u003eT\u003c/strong\u003e≤\u003cstrong\u003e\u003cstrong\u003e10\u003csup\u003e5\u003c/sup\u003e\u003c/strong\u003e\u003c/strong\u003e\u003c/li\u003e\n\t\u003cli\u003e\u003cb\u003e1\u003c/b\u003e≤\u003cb\u003eN\u003c/b\u003e≤\u003cstrong\u003e10\u003csup\u003e5\u003c/sup\u003e\u003c/strong\u003e\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003e1\u003c/strong\u003e≤\u003cstrong\u003eA\u003c/strong\u003e≤\u003cstrong\u003e26\u003c/strong\u003e\u003c/li\u003e\n\t\u003cli\u003e(sum of \u003cstrong\u003eN\u003c/strong\u003e in all test cases)≤\u003cstrong\u003e\u003cstrong\u003e10\u003csup\u003e5\u003c/sup\u003e\u003c/strong\u003e\u003c/strong\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003cp\u003e\n\tSubtask #1 (21 points):\u003c/p\u003e\n\u003cul\u003e\u003cli\u003e\u003cstrong\u003eN≤10\u003c/strong\u003e.\u003c/li\u003e\n\u003c/ul\u003e\u003cp\u003e\n\tSubtask #2 (79 points):\u003c/p\u003e\n\u003cul\u003e\u003cli\u003eoriginal constraints.\u003c/li\u003e\n\u003c/ul\u003e"}},{"title":"Sample 1","value":{"format":"MD","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\u003e4\n5 2\n12 26\n8 26\n7 2\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3 aaabb\n1 hapybirthday\n1 codechef\n3 aaababb\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp\u003e\n\t\u003cb\u003eExample case 1.\u003c/b\u003e There are multiple solutions. For example, \"abaaa\" is also correct. \u003cb\u003eNote that \"abbaa\" is not a correct solution, since \"abba\" is a palindromic substring of length 4, which is not optimal.\u003c/b\u003e\u003c/p\u003e\n"}}]}