{"trustable":true,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eDZY loves partitioning numbers. He wants to know whether it is possible to partition $n$ into the sum of exactly $k$ distinct positive integers.\u003cbr\u003e\u003cbr\u003eAfter some thinking he finds this problem is Too Simple. So he decides to maximize the product of these $k$ numbers. Can you help him?\u003cbr\u003e\u003cbr\u003eThe answer may be large. Please output it modulo $10^9+7$.\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"First line contains $t$ denoting the number of testcases.\u003cbr\u003e\u003cbr\u003e$t$ testcases follow. Each testcase contains two positive integers $n,k$ in a line.\u003cbr\u003e\u003cbr\u003e($1\\le t\\le 50, 2\\le n,k \\le 10^9$)\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For each testcase, if such partition does not exist, please output $-1$. Otherwise output the maximum product mudulo $10^9 + 7$.\u003cbr\u003e"}},{"title":"Sample","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\u003e4\r\n3 4\r\n3 2\r\n9 3\r\n666666 2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e-1\r\n2\r\n24\r\n110888111\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cbr\u003eIn 1st testcase, there is no valid partition.\u003cbr\u003eIn 2nd testcase, the partition is $3\u003d1+2$. Answer is $1\\times 2 \u003d 2$.\u003cbr\u003eIn 3rd testcase, the partition is $9\u003d2+3+4$. Answer is $2\\times 3 \\times 4 \u003d 24$. Note that $9\u003d3+3+3$ is not a valid partition, because it has repetition.\u003cbr\u003eIn 4th testcase, the partition is $666666\u003d333332+333334$. Answer is $333332\\times 333334\u003d 111110888888$. Remember to output it mudulo $10^9 + 7$, which is $110888111$.\u003cbr\u003e"}}]}