New Equipments

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

Little Q's factory recently purchased mm pieces of new equipment, labeled by 1,2,,m1,2,\dots,m.

There are nn workers in the factory, labeled by 1,2,,n1,2,\dots,n. Each worker can be assigned to no more than one piece of equipment, and no piece of equipment can be assigned to multiple workers. If Little Q assigns the ii-th worker to the jj-th piece of equipment, he will need to pay a_i×j2+b_i×j+c_ia\_i\times j^2+b\_i\times j+c\_i dollars.

Now please for every kk (1kn1\leq k\leq n) find kk pairs of workers and pieces of equipment, then assign workers to these pieces of equipment, such that the total cost for these kk workers is minimized.

입력

The first line contains a single integer TT (1T101 \leq T \leq 10), the number of test cases. For each test case:

The first line contains two integers nn and mm (1n501 \leq n \leq 50, nm108n\leq m\leq 10^8) denoting the number of workers and the number of pieces of equipment.

Each of the following nn lines contains three integers a_ia\_i, b_ib\_i, c_ic\_i (1a_i101\leq a\_i\leq 10, 108b_i108-10^8\leq b\_i\leq 10^8, 0c_i10160\leq c\_i\leq 10^{16}, b_i24a_ic_ib\_i^2\leq 4a\_ic\_i) describing a worker.

출력

For each test case, output a single line containing nn integers, the kk-th (1kn1\leq k\leq n) of which is the minimum possible total cost for kk pairs of workers and pieces of equipment.