{"trustable":true,"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":"","value":{"format":"HTML","content":"\u003cp\u003eDreamGrid is playing the music game \u003ci\u003eLive Love\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\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\n\u003cp\u003eAs DreamGrid 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\n\u003ch4\u003eInput\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\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\n\u003ch4\u003eOutput\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\n\u003ch4\u003eSample\u003c/h4\u003e\n\u003ctable class\u003d\"vjudge_sample\"\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\n5 4\n100 50\n252 52\n3 0\n10 10\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4 2\n50 1\n52 1\n0 0\n10 10\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\n\u003ch4\u003eHint\u003c/h4\u003e\n\u003cp\u003eLet\u0027s indicate a PERFECT as $P$ and a NON-PERFECT as $N$.\u003c/p\u003e\n\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"}}]}