You are given two positive integers $N$ and $K$, where $K \le N$. Find a sequence $A_1, A_2, \ldots, A_N$ such that:
- for each valid $i$, $A_i$ is either $i$ or $-i$
- there are exactly $K$ values of $i$ such that $1 \le i \le N$ and $A_1 + A_2 + \ldots + A_i > 0$
If there are multiple solutions, you may print any one of them. It can be proved that at least one solution always exists.

-----Input-----
- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
- The first and only line of each test case contains two space-separated integers $N$ and $K$.

-----Output-----
For each test case, print a single line containing $N$ space-separated integers $A_1, A_2, \ldots, A_N$.

-----Constraints-----
- $1 \le T \le 1,000$
- $1 \le K \le N \le 1,000$

-----Subtasks-----
Subtask #1 (10 points): $N \le 10$
Subtask #2 (90 points): original constraints

-----Example Input-----
1
3 3

-----Example Output-----
1 2 3

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = "# cook your dish here\n# Let's hack this code.\n\nfrom sys import stdin, stdout\nimport math\nfrom itertools import permutations, combinations\nfrom collections import defaultdict\nfrom bisect import bisect_left, bisect_right \n\nmod = 1000000007\n\ndef L():\n return list(map(int, stdin.readline().split()))\n\ndef In():\n return map(int, stdin.readline().split())\n\ndef I():\n return int(stdin.readline())\n\ndef printIn(ob):\n return stdout.write(str(ob)+'\\n')\n\ndef powerLL(n, p):\n result = 1\n while (p):\n  if (p&1):\n   result = result * n % mod\n  p = int(p / 2)\n  n = n * n % mod\n return result\n\n#--------------------------------------\n\ndef myCode():\n n,k = In()\n seq = []\n for i in range(1,n+1):\n  if i%2 == 0:\n   seq.append(-i)\n  else:\n   seq.append(i)\n if k == math.ceil(n/2):\n  print(*seq)\n elif k < math.ceil(n/2):\n  req = abs(k - (math.ceil(n/2)))\n  for i in range(n-1,-1,-1):\n   if seq[i] > 0:\n    seq[i] = -1 * seq[i]\n    req -= 1\n   if req == 0:\n    break\n  print(*seq)\n else:\n  req = abs(k - (math.ceil(n/2)))\n  for i in range(n-1,-1,-1):\n   if seq[i] < 0:\n    seq[i] = -1 * seq[i]\n    req -= 1\n   if req == 0:\n    break\n  print(*seq)\n  \ndef main():\n for t in range(I()):\n  myCode()\ndef __starting_point():\n main()\n__starting_point()"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 15343