spoj#BOULDER. Move the boulder

Move the boulder

A huge boulder is somehow blocking a public square. The citizens, each one of them approaching from his/her street, decide to remove it. Each citizen can try to either push the boulder away from him, pull it towards him, or choose to do nothing. (note that the citizens cannot change their direction relative to the boulder). Obviously, they want to remove the boulder as quickly as possible - in other words, they want to maximise the magnitude of the net force they apply. Tell them what this maximum possible magnitude is.

Input

The first line contains T (1≤T≤15), the number of test cases.

For each test case, the first line contains N (1 ≤ N ≤ 105), the number of citizens. Each of the next N lines contains four integers (seperated by single spaces) :

  • The first two integers (each ≤ 109) represent the x and y components (respectively) of the direction in which the citizen would push. If he pulls, it would be in the exactly opposite diretion. Note that this given "direction vector" does not necessarily have magnitude 1. However, its magnitude is indeed a meaningless quantity.
  • The next two integers Fpull and Fpush (1 ≤ Fpull, Fpush ≤ 105) represent the magnitude of the force the citizen applies while pulling and pushing, respectively.

Output

For each test case, output a single decimal number, correct to 6 digits after the decimal point, representing the maximum possible magnitude of resultant force.

Example

Input:
2
3
1 0 5 3
-3 0 12 6
0 1 4 7
1
13 6 58 24

Output: 16.5529 58

</p>