P11074 Fire Big

Background

![](https://cdn.luogu.com.cn/upload/image_hosting/bp0nfbj7.png)

Description

Given two positive integers $n, m$, find a sequence $a_1, a_2, \cdots, a_n$ of length $n$ that satisfies the following two requirements. - For any integer $i$ with $1 \le i \le n$, we have $0 \le a_i < m$, and $a_i$ is an integer. - For any integers $i, j$ with $1 \le i \le j \le n$, there exists an integer $k$ with $1 \le k \le j$ such that $a_k \in [\frac{m(i-1)}{j}, \frac{mi}{j})$. If such a sequence $a$ exists, output a construction; otherwise output `fire big`.

Input Format

**This problem has multiple test cases.** The first line contains a positive integer $T$, representing the number of test cases. Then follow $T$ test cases. For each test case, input two positive integers $n, m$, with the meaning as described in the statement.

Output Format

For each test case, if there exists a sequence $a$ that satisfies the requirements, output one line with $n$ numbers representing the sequence $a$. Otherwise, output one line `fire big`.

Explanation/Hint

**The Luogu code length limit is $\textbf{50\ KB}$.** ### Scoring For a certain test point, if your output correctly determines whether a solution exists or not, you can get at least $40\%$ of the score. In particular, if your output format is invalid, you may get $0$ points. One valid output format is outputting $n$ zeros on each line. ### Constraints For all testdata, it is guaranteed that $1 \le n \le 10^3$, $1 \le T \le 4.4\times 10^4$, $1 \le \sum n < 10^6$, and $1 \le m \le 10^8$. There are $12$ test points in total, and the test points are not equally weighted. The detailed score of each test point is as follows. |Test Point ID|Score|$n$|$m$| |:-:|:-:|:-:|:-:| |$1$|$5$|$\le 3$|$=n$| |$2$|$5$|$\le 5$|$\le 5$| |$3$|$5$|$\le 5$|$=10^8$| |$4$|$5$|$\le 5$|$\le 10^8$| |$5$|$5$|$\le 10$|$=n$| |$6$|$5$|$\le 10$|$\le 10^8$| |$7$|$5$|$\le 10^3$|$