There are n focuses on an endless plane. The I-th point has facilitates (xi,yi) to such an extent that xi>0 and yi>0. The directions are not really integer. In one maneuver you play out the accompanying activities: pick two focuses an and b (a≠b); move point a from (
Correct answer will be upvoted else downvoted.
There are n focuses on an endless plane. The I-th point has facilitates (xi,yi) to such an extent that xi>0 and yi>0. The directions are not really integer.
In one maneuver you play out the accompanying activities:
pick two focuses an and b (a≠b);
move point a from (xa,ya) to either (xa+1,ya) or (xa,ya+1);
move point b from (xb,yb) to either (xb+1,yb) or (xb,yb+1);
eliminate focuses an and b.
Notwithstanding, the move must be performed if there exists a line that goes through the new organizes of, another directions of b and (0,0).
If not, the move can't be performed and the focuses stay at their unique directions (xa,ya) and (xb,yb), individually.
Input
The main line contains a solitary integer n (1≤n≤2⋅105) — the number of focuses.
The I-th of the following n lines contains four integers
Output :In the primary line print a solitary integer c — the most extreme number of moves you can perform. Every one of the following c lines ought to contain a portrayal of a move: two integers an and b (1≤a,b≤n, a≠b) — the focuses that are taken out during the current move
Step by step
Solved in 3 steps with 1 images