{"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":"赵老师准备模仿坂本大佬的反复横跳秘技\u003cbr\u003e\n假设赵老师的起始位置是0\u003cbr\u003e\n他会先向右跳a个单位,再向左跳b个单位,之后不断重复\u003cbr\u003e\n你需要求出k次跳跃后赵老师所在的位置\u003cbr\u003e\n注意,赵老师将会进行多组练习!\u003cbr\u003e"}},{"title":"Input","value":{"format":"HTML","content":"第一行输入一个整数t,表示有t次训练(1≤t≤1000)\u003cbr\u003e\n之后有t行输入,每行有a,b ,k三个数(1≤a,b,k≤1,000,000,000)"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e对于每组数据,每行输出一个整数,代表赵老师当前的位置\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\n \u003cpre\u003e6\n1 1 1\n1 2 2\n1 1 3\n1 1 4\n1 1 5\n1 1 6\n\u003c/pre\u003e\n\n "}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e1\n-1\n1\n0\n1\n0\n\u003c/pre\u003e\n"}}]}