#434. Game on Plane
Game on Plane
Description
Alice and Bob are playing a game. In this game, there are straight lines on the 2D plane. Alice will select exactly straight lines among all the straight lines first, then Bob will draw a straight line . The penalty of Bob is defined as the number of lines in that shares at least one common point with . Note that two overlapping lines also share common points.
Alice wants to maximize the penalty of Bob while Bob wants to minimize it. You will be given these lines, please write a program to predict the penalty of Bob for if both of the players play optimally.
Format
Input
The first line contains a single integer (), the number of test cases. For each test case:
The first line contains a single integer (), denoting the number of straight lines.
Each of the next lines contains four integers and (, denoting a straight line passes both and . will never be coincided with .
It is guaranteed that the sum of all is at most .
Output
For each test case, output lines, the -th () of which containing an integer, denoting the penalty of Bob when .
Samples
2
2
1 1 2 2
0 0 2 3
3
1 1 2 2
1 1 2 2
3 2 5 4
0
1
0
0
0