| Codeforces Round 1080 (Div. 3) |
|---|
| Finished |
You are given a set of $$$n$$$ quadratic functions $$$F=\{f_1,f_2,\ldots,f_n \}$$$, where $$$f_i(x)=a_i x^2 + b_i x + c_i$$$.
Two functions $$$f$$$ and $$$g$$$ are called independent if $$$f(x) \neq g(x)$$$ for all $$$x \in \mathbb{R}$$$.
Also, a set of functions $$$G=\{g_1,g_2,\ldots,g_k\}$$$ is called organized if the two functions $$$g_i$$$ and $$$g_j$$$ are independent for all $$$1 \le i \lt j \le |G|$$$.
For each $$$i=1,2,\ldots,n$$$, please find the size of the largest organized subset of $$$F$$$ that contains $$$f_i$$$ as an element.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^4$$$). The description of the test cases follows.
The first line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 3000$$$).
Each of the $$$n$$$ following lines contains three integers $$$a_i$$$, $$$b_i$$$, $$$c_i$$$ denoting the function $$$f_i$$$ ($$$-10^6 \le a_i, b_i, c_i \le 10^6$$$, $$$a_i \neq 0$$$).
It is guaranteed that the functions in one test case are pairwise distinct.
It is guaranteed that the sum of $$$n^2$$$ over all test cases does not exceed $$$3000^2$$$.
For each test case, output $$$n$$$ integers $$$s_1,s_2,\ldots,s_n$$$, where $$$s_i$$$ is the size of the largest organized subset that contains $$$f_i$$$.
341 2 -1-3 0 -3-1 4 -51 2 -453 0 01 0 -5-3 0 0-1 0 101 0 -105884 -667 497680 -973 21323 -548 -412826 359 -333773 212 218
3 2 3 33 3 2 2 33 3 3 1 2
In the first test case, the functions are as follows:
The functions' graphs are as shown below:
The largest organized subsets of $$$F$$$ containing each function are as follows:
| Name |
|---|


