# Internet Problem Solving Contest

## Problem Q – Quite the cheater!

Your physics lab report is due tomorrow. However, you had no time to do the required experiments, as you spent all your time practicing for the IPSC. Therefore you decided to write a fake report quickly. Here is how to get a good grade for your lab report:

• It has to contain a lot of measurements.
• You already know the correct value you were supposed to measure. The mean of all “measured” values in your report has to be equal to that value.
• The values must look suﬃciently random to avoid suspicion that you made them all up. (Yeah, right.) More formally, they must have a suﬃcient variance.

Problem speciﬁcation

You are given two integers: the desired mean μ and the desired variance v.

Pick a number of measurements n and the values of those measurements a1,,an such that the mean of those values is exactly μ and their variance is (easy subproblem: at least v / hard subproblem: exactly v). Formally, your values must satisfy the following conditions:

• 10 n 1000
• Each ai is an integer between 109 and 109, inclusive.
• The value μ is exactly the mean: μ = (a1 + + an)∕n.
• The variance of your values is computed as follows: (1∕n) (a1 μ)2 + + (an μ)2 .

(If you are a statistics buﬀ, note that we are not using the unbiased sample variance formula (the one with 1(n1) instead of 1∕n), as in our case the mean is known a priori. If the previous sentence makes no sense, just ignore it and use the formula in the problem statement.)

• In the easy subproblem Q1: the variance of your values must be at least v.
• In the hard subproblem Q2: the variance of your values must be exactly v.

Input speciﬁcation

The ﬁrst line of the input ﬁle contains an integer t specifying the number of test cases. Each test case is preceded by a blank line.

Each test case contains a single line with two integers: μ and v.

You may assume that t 100, |μ|≤ 106, and 0 v 109.

Output speciﬁcation

For each test case, output two lines. The ﬁrst line should contain the number of values n, the second line a space-separated list of values a1,,an. Any valid solution will be accepted.

Example

input
1

47 2080
output
11
34 -7 102 117 16 8 0 130 36 34 47

This would be a correct solution to both subproblems. I.e., this sequence of 11 values has mean exactly 47 and variance exactly 2080.