Under construction

Still being built. Things may change

Quite the cheater!

Time limit1sMemory limit1024 MB

Summary
Given a mean mu and a variance v, build between 10 and 1000 integers whose mean is exactly mu and whose population variance is at least v (or exactly v).
Level

Medium6 of 10

Topics
Math, Implementation
Solved
No attempts yet

Statement

Your physics lab report is due tomorrow. You had no time to run the required experiments because you spent all your time practicing for the IPSC, so you decided to write a fake report. A good grade requires the following:

  • The report must contain many measurements.
  • You already know the correct value you were supposed to measure. The mean of all "measured" values must equal that value.
  • The values must look random enough to avoid suspicion. In other words, their variance must be large enough.

You are given integers μ\mu (the desired mean) and vv (the desired variance). Pick a number of measurements nn and values a1,…,ana_1, \ldots, a_n so that the mean is exactly μ\mu and the variance is at least vv (easy subproblem) or exactly vv (hard subproblem). The values must satisfy:

  • 10≤n≤100010 \le n \le 1000
  • Each aia_i is an integer with −109≤ai≤109-10^9 \le a_i \le 10^9.
  • The mean is exactly μ\mu: μ=a1+⋯+ann\mu = \frac{a_1 + \cdots + a_n}{n}.
  • The variance is 1n((a1−μ)2+⋯+(an−μ)2)\frac{1}{n}\left((a_1 - \mu)^2 + \cdots + (a_n - \mu)^2\right).

This is the population variance with 1/n1/n, not the unbiased sample variance with 1/(n−1)1/(n-1), because the mean is known in advance. Use the formula above.

Input

The first line contains an integer tt, the number of test cases. Each test case is preceded by a blank line.

Each test case is a single line with two integers μ\mu and vv. It is guaranteed that t≤100t \le 100, ∣μ∣≤106|\mu| \le 10^6, and 0≤v≤1090 \le v \le 10^9.

Output

For each test case, print two lines. The first line contains the number of values nn. The second line contains the space-separated values a1,…,ana_1, \ldots, a_n. Any valid solution is accepted.

Hint

This sequence of 11 values has mean exactly 47 and variance exactly 2080.

Examples1

  1. Example 1

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