Equilibrium State
Time limit1sMemory limit256 MB
Compute the equilibrium positions of spring-connected objects in the plane from fixed points, spring strengths, and connections.
Problem
When the sum of the forces acting on an object P is 0, P does not move. P is then said to be in an equilibrium state.

Figure 1. Forces acting on object P
Consider the situation in Figure 2. Two fixed points F1 and F2 lie on the x axis, and object P is attached to springs S1 and S2. Spring S1 joins F1 and P, and spring S2 joins F2 and P. Let and be the elastic coefficients of S1 and S2, and let and be the x coordinates of F1 and F2. By Hooke's law the force that S1 applies to P is , and the force that S2 applies to P is , where is the x coordinate of P.

Figure 2. An example of an equilibrium state
For example, in Figure 2 with , , , , and P in an equilibrium state, the position of P is determined as .
Now consider several objects joined by several springs in the plane, as in Figure 3. There are fixed points , objects , and springs , where spring has elastic coefficient . Each spring joins a fixed point and an object, or two objects. Hooke's law holds in the plane as well: a spring with coefficient joining points A and B applies the vector force to A, and the same formula applies to the x component and to the y component separately. If every object is attached to at least two springs, all objects eventually reach an equilibrium state, and the position of every object is then determined.
Write a program that computes the positions of the objects in the equilibrium state from the coordinates of the fixed points, the elastic coefficients of the springs, and the connections among objects and fixed points.

Figure 3. Another example of an equilibrium state in the plane
You can assume the following.
- Every object is attached to at least two springs, and any two points among the objects and the fixed points are joined through one or more springs.
- At most one spring joins a given (object, object) pair or a given (object, fixed point) pair.
- At least three fixed points do not lie on one straight line.
- When all objects are in an equilibrium state, no two springs cross each other and no two objects sit at the same position.
- No two fixed points have the same coordinates.
Input
Read from standard input. The first line contains the number of test cases .
The first line of each test case contains three integers (), (), and (), separated by blanks. Here is the number of fixed points, is the number of springs, and is the number of objects.
The -th of the next lines contains the integer coordinates and () of fixed point .
The -th of the next lines contains three integers , , and . Here () is the elastic coefficient of spring , and and are the indices of the two endpoints that joins. A negative means fixed point (), and a positive means object (). Read the same way.
Output
Write to standard output. For each test case, first print one line holding Test case number : followed by the number of the test case. Numbering starts at 1. Then print lines; the -th of them holds the index and the coordinates and of object , separated by single blanks.
Print each coordinate with two digits after the decimal point, rounding at the third digit. Round away from zero, and when the rounded value is zero print 0.00 with no sign. The exact value of every answer coordinate is at least away from a rounding boundary, so the string to print is determined.