{"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\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\u003cspan class\u003d\"tex-font-style-it\"\u003e在这个问题中,与问题A不同,你需要寻找的是\u003cspan class\u003d\"tex-font-style-bf\"\u003e最不幸的数字\u003c/span\u003e,而不是最幸运的。\u003c/span\u003e\u003c/p\u003e\u003cp\u003e\u003cspan class\u003d\"tex-font-style-bf\"\u003e请注意,这个问题的约束条件与问题A中的不同。\u003c/span\u003e\u003c/p\u003e\u003cp\u003e奥林匹斯城最近推出了个人星际飞船的生产。现在火星上的每个人都可以购买一艘并以低廉的价格飞往其他行星。\u003c/p\u003e\u003cp\u003e每艘星际飞船都有一个数字 —— 一个正整数 $$$x$$$。让我们将一个数字 $$$x$$$ 的\u003cspan class\u003d\"tex-font-style-it\"\u003e幸运度\u003c/span\u003e定义为该数字的最大数字和最小数字之间的差。例如,$$$142857$$$ 的最大数字是 $$$8$$$,最小数字是 $$$1$$$,所以它的幸运度是 $$$8-1\u003d7$$$。而数字 $$$111$$$ 的所有数字都相等于 $$$1$$$,所以它的幸运度为零。\u003c/p\u003e\u003cp\u003eHateehc 是一位著名的火星博主,经常飞往太阳系不同的角落。为了更快发布有趣的视频,他决定购买一艘星际飞船。当他来到商店时,看到的星际飞船的数字范围是从 $$$l$$$ 到 $$$r$$$。在商店里,Hateehc 想要找到一个具有\u003cspan class\u003d\"tex-font-style-bf\"\u003e最不幸的\u003c/span\u003e数字的星际飞船。\u003c/p\u003e\u003cp\u003e由于商店里有很多星际飞船,而 Hateehc 不会编程,所以你必须帮助这位博主并编写一个程序来回答他的问题。\u003c/p\u003e\u003ccenter\u003e \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/b410c3c4c836cf26fbace907dcadeccb?v\u003d1714133682\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \u003c/center\u003e"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e第一行包含一个整数 $$$t$$$ ($$$1 \\le t \\le 600$$$) —— 测试用例的数量。\u003c/p\u003e\u003cp\u003e接下来的 $$$t$$$ 行中,每行包含一个测试用例的描述。描述由两个整数 $$$l$$$, $$$r$$$ ($$$1 \\le l \\le r \\le 10^{18}$$$) —— 商店中星际飞船的最大和最小数字组成。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e输出 $$$t$$$ 行,每行包含商店中最不幸的星际飞船数字。\u003c/p\u003e\u003cp\u003e如果有多种选择最不幸的数字的方式,可以输出其中任意一种。\u003c/p\u003e"}},{"title":"示例","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\u003e5\n59 63\n42 49\n48 53\n90 90\n1 100\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e63\n44\n53\n90\n1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"注意","value":{"format":"HTML","content":"\u003cp\u003e让我们看两个测试例子:\u003c/p\u003e\u003cul\u003e \u003cli\u003e 数字 $$$59$$$ 的幸运度是 $$$9 - 5 \u003d 4$$$; \u003c/li\u003e\u003cli\u003e $$$60$$$ 的幸运度等于 $$$6 - 0 \u003d 6$$$; \u003c/li\u003e\u003cli\u003e $$$61$$$ 的幸运度等于 $$$6 - 1 \u003d 5$$$; \u003c/li\u003e\u003cli\u003e $$$62$$$ 的幸运度等于 $$$6 - 2 \u003d 4$$$; \u003c/li\u003e\u003cli\u003e 数字 $$$63$$$ 的幸运度是 $$$6 - 3 \u003d 3$$$。 \u003c/li\u003e\u003c/ul\u003e 所以最不幸的数字是 $$$63$$$。\u003cp\u003e在第五个测试用例中,最不幸的数字有 $$$1$$$、$$$2$$$、$$$3$$$、$$$4$$$、$$$5$$$、$$$6$$$、$$$7$$$、$$$8$$$、$$$9$$$、$$$11$$$、$$$22$$$、$$$33$$$、$$$44$$$、$$$55$$$、$$$66$$$、$$$77$$$、$$$88$$$、$$$99$$$,因此可以选择其中任意一个。\u003c/p\u003e"}}]}