题目:给定n和k,要求找到k个相同奇偶性的数字的和为n
思路:只要(k-1)%2==n%2就表明有解,如果两个都为偶数则输出k-1个2和n-(k-1)*2,
如果为奇数就输出k-1个1和n-k+1
for _ in range(int(input())):
n, k = map(int, input().split())
for i in range(1,3):
if k*i <= n and k*i%2==n%2:
print('YES')
print(*[i for j in range(k-1)]+[n-(k-1)*i])
break
else:
print('NO')