{"trustable":false,"prependHtml":"\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Desciption","value":{"format":"HTML","content":"\t\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n\t MathJax.Hub.Config({\n\t extensions: [\"tex2jax.js\"],\n\t jax: [\"input/TeX\", \"output/SVG\"],\n\t tex2jax: {\n\t inlineMath: [ [\u0027$\u0027,\u0027$\u0027], [\"\\\\(\",\"\\\\)\"] ],\n\t displayMath: [ [\u0027$$\u0027,\u0027$$\u0027], [\"\\\\[\",\"\\\\]\"] ],\n\t processEscapes: true\n\t },\n\t });\n\t\u003c/script\u003e\n\t\u003cscript type\u003d\"text/javascript\"\n\t src\u003d\"https://cdn.staticfile.org/mathjax/2.7.0/MathJax.js\"\u003e\n\t\u003c/script\u003e\n \u003cp\u003eIn the evening of 2018.10.18, all of the faculty members of CJLU gathered in JiaLiang Big Hall celebrating the most meaningful day. On the Anniversary Gala, when the spotlights gathered on the stage, Professor Li appeared, devoting a beautiful song: \u003cvar\u003eChina, I Love You.\u003c/var\u003e\n \u003cp\u003eTo practice the song better at the anniversary gala, Professor Li often play the music game \u003ci\u003eKing of Karaoke\u003c/i\u003e. He has just finished a song consisting of $n$ notes and got a result sequence $A_1, A_2, \\dots, A_n$ ($A_i \\in$ {PERFECT, NON-PERFECT}). The score of the song is equal to the \\textit{max-combo} of the result sequence, which is defined as the maximum number of continuous PERFECTs in the sequence.\u003c/p\u003e \n \u003cp\u003eFormally speaking, $\\text{max-combo}(A) \u003d \\max$ {$k$ | $k$ is an integer and there exists an integer $i$ ($1 \\le i \\le n-k+1$) such that $A_i \u003d A_{i+1} \u003d A_{i+2} \u003d \\dots \u003d A_{i+k-1} \u003d $ PERFECT}. For completeness, we define max($\\emptyset$) \u003d 0.\u003c/p\u003e \n \u003cp\u003eAs Professor Li is forgetful, he forgets the result sequence immediately after finishing the song. All he knows is the sequence length $n$ and the total number of PERFECTs in the sequence, indicated by $m$. Any possible score $s$ he may get must satisfy that there exists a sequence $A\u0027$ of length $n$ containing exactly $m$ PERFECTs and $(n-m)$ NON-PERFECTs and $\\text{max-combo}(A\u0027) \u003d s$. Now he needs your help to find the maximum and minimum $s$ among all possible scores.\u003c/p\u003e \n "}},{"title":"Input","value":{"format":"HTML","content":"\u003c/h4\u003e \n \u003cp\u003eThere are multiple test cases. The first line of the input contains an integer $T$($1 \\le T \\le 100$), indicating the number of test cases. For each test case:\u003c/p\u003e \n \u003cp\u003eThe only line contains two integers $n$ and $m$ ($1 \\le n \\le 10^3$, $0 \\le m \\le 10^3$, $m \\le n$), indicating the sequence length and the number of PERFECTs DreamGrid gets.\u003c/p\u003e \n \u003ch4"}},{"title":"Output","value":{"format":"HTML","content":"\u003c/h4\u003e \n \u003cp\u003eFor each test case output one line containing two integers $s_{max}$ and $s_{min}$, indicating the maximum and minimum possible score.\u003c/p\u003e \n \u003ch4"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003c/h4\u003e \n \u003cpre\u003e5\n5 4\n100 50\n252 52\n3 0\n10 10\n\u003c/pre\u003e \n \u003ch4"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003c/h4\u003e \n \u003cpre\u003e4 2\n50 1\n52 1\n0 0\n10 10\n\u003c/pre\u003e \n \u003ch4"}},{"title":"Hint","value":{"format":"HTML","content":"\u003c/h4\u003e \n \u003cp\u003eLet\u0027s indicate a PERFECT as $P$ and a NON-PERFECT as $N$.\u003c/p\u003e \n \u003cp\u003eFor the first sample test case, the sequence $(P,P,P,P,N)$ leads to the maximum score and the sequence $(P,P,N,P,P)$ leads to the minimum score.\u003c/p\u003e \n "}}]}