{"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\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 type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cstyle type\u003d\u0027text/css\u0027\u003e .input, .output {border: 1px solid #888888;} .output {margin-bottom:1em;position:relative;top:-1px;} .output pre,.input pre {background-color:#EFEFEF;line-height:1.25em;margin:0;padding:0.25em;} .title {background-color:#FFFFFF;border-bottom: 1px solid #888888;font-family:arial;font-weight:bold;padding:0.25em;} \u003c/style\u003e \u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027]], displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027]]}\n });\n \u003c/script\u003e\n \u003cscript type\u003d\"text/javascript\" async\n src\u003d\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\"\u003e\n \u003c/script\u003e\n\u003cp\u003eIn a car factory each car needs to go through \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e stages in order to be ready for sale, and each stage needs one day to be completed.\u003c/p\u003e\n\u003cp\u003eThe process in the factory goes as follows. On the first day a car enters the first stage. On the second day a car moves from the first stage to the second stage, and a new car enters the first stage. On the third day a car moves from the second stage to the third stage, a car moves from the first stage to the second stage, and a new car enters the first stage, and so on. After \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e days (i.e. \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e stages) the car will be ready for sale.\u003c/p\u003e\n\u003cp\u003eYour task is simple, given the number of stages for each car to be ready, and the number of cars to be manufactured. How many days are needed to finish manufacturing all the cars?\u003c/p\u003e\n\u003cp\u003e在汽车制造厂中,每辆汽车需要经过k个阶段才能准备好出售,每个阶段需要一天才能完成。\u003c/p\u003e\n\u003cp\u003e工厂中的过程如下。 在第一天,第一辆汽车进入第一阶段。 在第二天,第一辆汽车从第一阶段移至第二阶段,而一辆新车进入第一阶段。 在第三天,第一辆汽车从第二阶段移至第三阶段,第二辆汽车从第一阶段移至第二阶段,新车进入第一阶段,依此类推。 在k天(即k阶段)后,汽车将准备出售。\u003c/p\u003e\n\u003cp\u003e给定要准备的每辆汽车的阶段数和要制造的汽车数,您的任务很简单。 完成所有汽车的制造需要多少天?\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the input contains an integer T (1 \u003cspan class\u003d\"tex-span\"\u003e ≤ \u003c/span\u003e \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eT\u003c/i\u003e\u003c/span\u003e \u003cspan class\u003d\"tex-span\"\u003e ≤ \u003c/span\u003e 1000), where T is the number of the test cases.\u003c/p\u003e\n\u003cp\u003eEach test case has one line that contains two integers \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e (1 \u003cspan class\u003d\"tex-span\"\u003e ≤ \u003c/span\u003e \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e \u003cspan class\u003d\"tex-span\"\u003e ≤ \u003c/span\u003e \u003cspan class\u003d\"tex-span\"\u003e10\u003csup class\u003d\"upper-index\"\u003e9\u003c/sup\u003e\u003c/span\u003e), the number of cars to be manufactured and the number of stages each car requires.\u003c/p\u003e\n\u003cp\u003e输入的第一行包含一个整数T(1≤T≤1000),其中T是测试用例的数量。\u003c/p\u003e\n\n\u003cp\u003e每个测试用例都有一行包含两个整数n和k(1≤n,k≤\u003cspan class\u003d\"tex-span\"\u003e10\u003csup class\u003d\"upper-index\"\u003e9\u003c/sup\u003e\u003c/span\u003e),表示要制造的汽车数量以及完成每辆汽车需要的阶段数。\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, print a single integer that represents the number of required days to manufacture all the cars.\u003c/p\u003e\n\u003cp\u003e对于每个测试用例,请打印一个整数,该整数表示制造所有汽车所需的天数。\u003c/p\u003e"}},{"title":"Examples","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\u003e4\u003cbr\u003e1 1\u003cbr\u003e2 3\u003cbr\u003e4 3\u003cbr\u003e14526 78965\u003cbr\u003e\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\u003cbr\u003e4\u003cbr\u003e6\u003cbr\u003e93490\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eLet\u0027s solve the third case to show how the process goes in the factory: \u003c/p\u003e\n\u003cul\u003e\u003c/ul\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cli\u003e \u003cspan class\u003d\"tex-font-style-bf\"\u003eFirst day\u003c/span\u003e: The first car will enter the first stage.\u003c/li\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cli\u003e \u003cspan class\u003d\"tex-font-style-bf\"\u003eSecond day\u003c/span\u003e: The first car will move to the second stage, and the second car will enter the first stage.\u003c/li\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cli\u003e \u003cspan class\u003d\"tex-font-style-bf\"\u003eThird day\u003c/span\u003e: The first car will move to the third stage, the second car will move to the second stage, and the third car will enter the first stage. At the end of this day the first car will be ready for sale.\u003c/li\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cli\u003e \u003cspan class\u003d\"tex-font-style-bf\"\u003eFourth day\u003c/span\u003e: The second car will move to the third stage, the third car will move to the second stage, and the fourth car will enter the first stage. At the end of this day the second car will be ready for sale.\u003c/li\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cli\u003e \u003cspan class\u003d\"tex-font-style-bf\"\u003eFifth day\u003c/span\u003e: The third car will move to the third stage, and the fourth car will move to the second stage. At the end of this day the third car will be ready for sale.\u003c/li\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cli\u003e \u003cspan class\u003d\"tex-font-style-bf\"\u003eSixth day\u003c/span\u003e: The fifth car will move to the third stage. At the end of this day the fourth car will be ready for sale.\u003c/li\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cp\u003e让我们解决第三种情况,以显示该过程在工厂中如何进行:\u003c/p\u003e\n\n\u003cp\u003e第一天:第一辆车将进入第一阶段。\u003c/p\u003e\n\u003cp\u003e第二天:第一辆车将进入第二阶段,第二辆车将进入第一阶段。\u003c/p\u003e\n\u003cp\u003e第三天:第一辆车进入第三阶段,第二辆车进入第二阶段,第三辆车进入第一阶段。 在这一天结束时,第一辆汽车将准备出售。\u003c/p\u003e\n\u003cp\u003e第四天:第二辆车将进入第三阶段,第三辆车将进入第二阶段,第四辆车将进入第一阶段。 在这一天结束时,第二辆车将准备出售。\u003c/p\u003e\n\u003cp\u003e第五天:第三辆车将进入第三阶段,第四辆车将进入第二阶段。 在这一天结束时,第三辆车将准备出售。\u003c/p\u003e\n\u003cp\u003e第六天:第四辆车将进入第三阶段。 在这一天结束时,第四辆车将准备出售。(我怀疑他英文有点小问题)\u003cp\u003e"}}]}