{"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":"MD","content":"众所周知,ymzs666是一名跳远能手,最擅长的就是反复横跳。现在他正在坐标0处,要进行这样的跳跃:第一次向右跳a单位,第二次向左跳b单位,第三次向右跳a单位,第四次向左跳b单位,如此反复。\n你的任务是计算k次跳跃之后awen的位置。"}},{"title":"Input","value":{"format":"MD","content":"第一行输入一个整数t,表示有t次查询(1≤t≤1000)\u003cp\u003e\n之后有t行输入,每行有a,b ,k三个数(1≤a,b,k≤10\u003csup\u003e9\u003c/sup\u003e)"}},{"title":"Output","value":{"format":"MD","content":"\u003cp\u003e对于每组数据,输出一个整数,代表awen当前坐标\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"MD","content":"\n \u003cpre\u003e6\n5 2 3\n100 1 4\n1 10 5\n1000000000 1 6\n1 1 1000000000\n1 1 999999999\n\u003c/pre\u003e\n\n "}},{"title":"Sample Output","value":{"format":"MD","content":"\u003cpre\u003e8\n198\n-17\n2999999997\n0\n1\n\u003c/pre\u003e\n"}}]}