{"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":"\u003cp\u003e给定一个整数$$$n$$$。你需要改变最少的整数位数,使所得的数字没有\u003cspan class\u003d\"tex-font-style-bf\"\u003e任何前导零\u003c/span\u003e,并能\u003cspan class\u003d\"tex-font-style-bf\"\u003e被7整除\u003c/span\u003e。\n\u003cp\u003e如果有多种方法,请打印其中任何一种。如果给定的数字已经能被7整除,则保持不变。\n\u003cp\u003eYou are given an integer $$$n$$$. You have to change the minimum number of digits in it in such a way that the resulting number \u003cspan class\u003d\"tex-font-style-bf\"\u003edoes not have any leading zeroes\u003c/span\u003e and \u003cspan class\u003d\"tex-font-style-bf\"\u003eis divisible by $$$7$$$\u003c/span\u003e.\u003c/p\u003e\n\u003cp\u003eIf there are multiple ways to do it, print any of them. If the given number is already divisible by $$$7$$$, leave it unchanged.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e第一行包含一个整数$$$t$$$ ($$$1 \\le t \\le 990$$$) — 测试样例的组数.\u003c/p\u003e\n\u003cp\u003e对于每一个样例,都包含一个整数 $$$n$$$ ($$$10 \\le n \\le 999$$$).\u003c/p\u003e\n\u003cp\u003eThe first line contains one integer $$$t$$$ ($$$1 \\le t \\le 990$$$) — the number of test cases.\u003c/p\u003e\n\u003cp\u003eThen the test cases follow, each test case consists of one line containing one integer $$$n$$$ ($$$10 \\le n \\le 999$$$).\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e对于每个测试案例,打印一个没有任何前导零的整数--你修改的结果(即能被$$$7$$$整除的整数,并且可以通过改变$$$n$$$中的最小可能数字得到)。\n\u003cp\u003e如果有多种方法可以改变,则打印任何结果的数字。如果给定的数字已经能被$$$7$$$整除,就打印它。\n\u003cp\u003eFor each test case, print one integer without any leading zeroes — the result of your changes (i. e. the integer that is divisible by $$$7$$$ and can be obtained by changing the minimum possible number of digits in $$$n$$$).\u003c/p\u003e\n\u003cp\u003eIf there are multiple ways to apply changes, print any resulting number. If the given number is already divisible by $$$7$$$, just print it.\u003c/p\u003e"}},{"title":"Sample 1","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\u003e3\n42\n23\n377\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e42\n28\n777\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\u003e在测试案例1中,$$$42$$$已经可以被$$$7$$$整除了,所以没有必要改变它。\n\n\u003cp\u003e在测试案例2中,有多个答案—$$$28$$$, $$$21$$$ or $$$63$$$.\n\n\u003cp\u003e在测试案例3中,其他可能的答案是$$$357$$$, $$$371$$$ 和$$$378$$$.。注意,你\u003cspan class\u003d\"tex-font-style-bf\"\u003e不能\u003c/span\u003e打印$$$077$$$ 或$$$77$$$。\n\u003cp\u003eIn the first test case of the example, $$$42$$$ is already divisible by $$$7$$$, so there\u0027s no need to change it.\u003c/p\u003e\n\u003cp\u003eIn the second test case of the example, there are multiple answers — $$$28$$$, $$$21$$$ or $$$63$$$.\u003c/p\u003e\n\u003cp\u003eIn the third test case of the example, other possible answers are $$$357$$$, $$$371$$$ and $$$378$$$. Note that you \u003cspan class\u003d\"tex-font-style-bf\"\u003ecannot\u003c/span\u003e print $$$077$$$ or $$$77$$$.\u003c/p\u003e"}}]}