{"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\"\u003eMike does not want others to view his messages, so he find a encode method Base64.\u003cbr\u003e\u003cbr\u003eHere is an example of the note in Chinese Passport.\u003cbr\u003e\u003cbr\u003eThe Ministry of Foreign Affairs of the People\u0027s Republic of China requests all civil and military authorities of foreign countries to allow the bearer of this passport to pass freely and afford assistance in case of need.\u003cbr\u003e\u003cbr\u003eWhen encoded by \\texttt{Base64}, it looks as follows\u003cbr\u003e\u003cbr\u003eVGhlIE1pbmlzdHJ5IG9mIEZvcmVpZ24gQWZmYWlycyBvZiB0aGUgUGVvcGxlJ3MgUmVwdWJsaWMgb2Yg\u003cbr\u003eQ2hpbmEgcmVxdWVzdHMgYWxsIGNpdmlsIGFuZCBtaWxpdGFyeSBhdXRob3JpdGllcyBvZiBmb3JlaWdu\u003cbr\u003eIGNvdW50cmllcyB0byBhbGxvdyB0aGUgYmVhcmVyIG9mIHRoaXMgcGFzc3BvcnQgdG8gcGFzcyBmcmVl\u003cbr\u003ebHkgYW5kIGFmZm9yZCBhc3Npc3RhbmNlIGluIGNhc2Ugb2YgbmVlZC4\u003d\u003cbr\u003e\u003cbr\u003eIn the above text, the encoded result of \\texttt{The} is \\texttt{VGhl}. Encoded in ASCII, the characters \\texttt{T}, \\texttt{h}, and \\texttt{e} are stored as the bytes $84$, $104$, and $101$, which are the $8$-bit binary values $01010100$, $01101000$, and $01100101$. These three values are joined together into a 24-bit string, producing $010101000110100001100101$.\u003cbr\u003eGroups of $6$ bits ($6$ bits have a maximum of $2^6 \u003d 64$ different binary values) are converted into individual numbers from left to right (in this case, there are four numbers in a 24-bit string), which are then converted into their corresponding Base64 encoded characters. The Base64 index table is\u003cbr\u003e\u003cbr\u003e0123456789012345678901234567890123456789012345678901234567890123\u003cbr\u003eABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\u003cbr\u003e\u003cbr\u003eIn the above example, the string $010101000110100001100101$ is divided into four parts $010101$, $000110$, $100001$ and $100101$, and converted into integers $21, 6, 33$ and $37$. Then we find them in the table, and get V, G, h, l.\u003cbr\u003e\u003cbr\u003eWhen the number of bytes to encode is not divisible by three (that is, if there are only one or two bytes of input for the last 24-bit block), then the following action is performed:\u003cbr\u003e\u003cbr\u003eAdd extra bytes with value zero so there are three bytes, and perform the conversion to base64. If there was only one significant input byte, only the first two base64 digits are picked (12 bits), and if there were two significant input bytes, the first three base64 digits are picked (18 bits). \u0027\u003d\u0027 characters are added to make the last block contain four base64 characters.\u003cbr\u003e\u003cbr\u003eAs a result, when the last group contains one bytes, the four least significant bits of the final 6-bit block are set to zero; and when the last group contains two bytes, the two least significant bits of the final 6-bit block are set to zero.\u003cbr\u003e\u003cbr\u003eFor example, base64(A) \u003d QQ\u003d\u003d, base64(AA) \u003d QUE\u003d.\u003cbr\u003e\u003cbr\u003eNow, Mike want you to help him encode a string for $k$ times. Can you help him?\u003cbr\u003e\u003cbr\u003eFor example, when we encode A for two times, we will get base64(base64(A)) \u003d UVE9PQ\u003d\u003d.\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u0026nbsp;\u0026nbsp;The first line contains an integer $T$($T \\le 20$) denoting the number of test cases.\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u003cbr\u003e\u0026nbsp;\u0026nbsp;In the following $T$ lines, each line contains a case. In each case, there is a number $k (1 \\leq k \\leq 5)$ and a string $s$. $s$ only contains characters whose ASCII value are from $33$ to $126$(all visible characters). The length of $s$ is no larger than $100$."}},{"title":"Output","value":{"format":"HTML","content":"\u0026nbsp;\u0026nbsp;For each test case, output Case #t:, to represent this is t-th case. And then output the encoded string.\u003cbr\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\n1 Mike\r\n4 Mike\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase #1: TWlrZQ\u003d\u003d\r\nCase #2: Vmtaa2MyTnNjRkpRVkRBOQ\u003d\u003d\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}