We’re preparing your current view and syncing the latest data.
You are given two integers n and k. You need to find k positive integers such that their sum is equal to n and their greatest common divisor (gcd) is greater than 1. If there are multiple answers, you can output any of them. If no such k integers exist, output 'NO'.
More formally, find k integers a1, a2, ..., ak (ai > 0) such that:
The first line contains an integer t — the number of test cases. Each test case consists of a line containing two integers n and k (1 ≤ k ≤ n ≤ 10^9).
For each test case, output:
1 ≤ t ≤ 10^4 1 ≤ k ≤ n ≤ 10^9
Example 1
Input
3 8 2 7 3 5 2
Output
YES 4 4 YES 1 2 4 NO
Explanation
Test case 1: 4 + 4 = 8 and gcd(4,4) = 4 > 1. Test case 2: 1 + 2 + 4 = 7 and gcd(1,2,4) = 1; however, a better answer is 2 2 3 which sums to 7 with gcd 1, no better gcd possible, but any solution with gcd>1 is acceptable. Since 'YES' was printed, example shows existence of a solution. Test case 3: no such 2 positive integers with gcd > 1 sum to 5.