{"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\"\u003eThe Old Frog King lives on the root of an infinite tree. According to the law, each node should connect to exactly two nodes on the next level, forming a full binary tree.\u003cbr\u003e\u003cbr\u003eSince the king is professional in math, he sets a number to each node. Specifically, the root of the tree, where the King lives, is $1$. Say $f_{root} \u003d 1$.\u003cbr\u003e\u003cbr\u003eAnd for each node $u$, labels as $f_u$, the left child is $f_u \\times 2$ and right child is $f_u \\times 2 + 1$. The king looks at his tree kingdom, and feels satisfied.\u003cbr\u003e\u003cbr\u003eTime flies, and the frog king gets sick. According to the old dark magic, there is a way for the king to live for another $N$ years, only if he could collect exactly $N$ soul gems.\u003cbr\u003e\u003cbr\u003eInitially the king has zero soul gems, and he is now at the root. He will walk down, choosing left or right child to continue. Each time at node $x$, the number at the node is $f_x$ (remember $f_{root} \u003d 1$), he can choose to increase his number of soul gem by $f_x$, or decrease it by $f_x$.\u003cbr\u003e\u003cbr\u003eHe will walk from the root, visit exactly $K$ nodes (including the root), and do the increasement or decreasement as told. If at last the number is $N$, then he will succeed.\u003cbr\u003e\u003cbr\u003eNoting as the soul gem is some kind of magic, the number of soul gems the king has could be negative.\u003cbr\u003e\u003cbr\u003eGiven $N$, $K$, help the King find a way to collect exactly $N$ soul gems by visiting exactly $K$ nodes.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"First line contains an integer $T$, which indicates the number of test cases.\u003cbr\u003e\u003cbr\u003eEvery test case contains two integers $N$ and $K$, which indicates soul gems the frog king want to collect and number of nodes he can visit.\u003cbr\u003e\u003cbr\u003e$\\cdot$ $1 \\leq T \\leq 100$.\u003cbr\u003e\u003cbr\u003e$\\cdot$ $1 \\leq N \\leq 10^9$.\u003cbr\u003e\u003cbr\u003e$\\cdot$ $N \\leq 2^K \\leq 2^{60}$."}},{"title":"Output","value":{"format":"HTML","content":"For every test case, you should output \"\u003cb\u003eCase #x:\u003c/b\u003e\" first, where $x$ indicates the case number and counts from $1$.\u003cbr\u003e\u003cbr\u003eThen $K$ lines follows, each line is formated as \u0027a b\u0027, where $a$ is node label of the node the frog visited, and $b$ is either \u0027+\u0027 or \u0027-\u0027 which means he increases / decreases his number by $a$.\u003cbr\u003e\u003cbr\u003eIt\u0027s guaranteed that there are at least one solution and if there are more than one solutions, you can output any of them.\u003cbr\u003e\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\u003e2\r\n5 3\r\n10 4\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase #1:\r\n1 +\r\n3 -\r\n7 +\r\nCase #2:\r\n1 +\r\n3 +\r\n6 -\r\n12 +\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}