TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description

Let's consider a string of non-negative integers containing N elements. Suppose these elements are S1 S2 .. SN, in the order in which they are placed inside the string. Such a string is called 'funny' if the string S1+1 S2 S3 .. SN-1 SN -1 can be obtained by rotating the first string (to the left or to the right) several times.


For instance, the strings "2 2 2 3" and "1 2 1 2 2" are funny, but the string "1 2 1 2" is not. Your task is to find a funny string having N elements, for which the sum of its elements (S1+S2+..+SN) is equal to K.
Warn: 本題有 specialjudge

Input Format

The first line contains one integer T, indicating the number of testcases.

Each testcase contains two integers: N and K. Moreover, GCD(N,K)=1. (it can be proven that this is a necessary condition for a string to be funny).

1 <= T <= 200

2 <= N <= 1000

1 <= K <= 30000

Output Format

For each testcase, output a funny string that satisfy the given constraints.

Sample Input 1

2
9 16
7 8

Sample Output 1

1 2 2 2 1 2 2 2 2
1 1 1 1 1 1 2

Hints

Problem Source

Migrated from old NTUJ.

sgu

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 2000 65536 1000