{"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":"You are given an array $a$ of $n$ integers, and an integer $k$. You have to make $k$ operations such that at each operation you need to choose an element $a_i$ from the array and replace it with $-a_i$.\n\nYour task is to find the optimal way to make the $k$ operations such that at the end the sum of the array $a$ is as maximal as possible. Can you?"}},{"title":"Input","value":{"format":"HTML","content":"The first line contains an integer $T$ ($1 \\le T \\le 100$) specifying the number of test cases.\n\nThe first line of each test case contains two integers $n$ and $k$ ($1 \\le n \\le 10^4$, $0 \\le k \\le 10^4$), in which $n$ is the size of the array, and $k$ is the number of operations to be made.\n\nThen a line follows contains $n$ integers $a_1, \\cdots, a_n$ ($-100 \\le a_i \\le 100$), giving the array $a$.\n"}},{"title":"Output","value":{"format":"HTML","content":"For each test case, print a single line containing the maximum sum of array $a$ after making the required number of operations."}},{"title":"Sample 1","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\u003e3\n3 1\n4 6 2\n4 2\n-1 0 2 1\n5 2\n1 7 -4 2 -3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e8\n4\n17\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first test case, the optimal way is to make the negation operation on $$$a_3$$$. After this, the array will be \u003d $$$[4, 6, -2]$$$, and its sum is $$$8$$$.\u003c/p\u003e"}},{"title":"","value":{"format":"HTML","content":""}}]}