{"trustable":false,"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"描述","value":{"format":"HTML","content":"给你一个正整数n。你真的很喜欢好的数字,所以你想找到最小的好数字大于或等于n。\n如果正整数可以表示为3的不同幂的和(即不允许3的幂的重复),则称为好整数。"}},{"title":"Input","value":{"format":"HTML","content":"输入的第一行包含一个整数q(1≤q≤500)-查询数。接下来是q查询。\n查询的唯一一行包含一个整数n(1≤n≤10.....0(此处有18个0))。"}},{"title":"Output","value":{"format":"HTML","content":"对于给定的正整数n,找到最小的m(n≤m),m是一个好数。"}},{"title":"Example","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e8\n1\n2\n6\n13\n14\n3620\n10000\n1000000000000000000\n\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e1\n3\n9\n13\n27\n6561\n19683\n1350851717672992089\n\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}}]}