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 (

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter13: Decision Making Under Uncertainty
Section13.4: Decision Trees
Problem 9P
icon
Related questions
Question
100%

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 ai,bi,ci,di (1≤ai,bi,ci,di≤109). The directions of the I-th point are xi=aibi and yi=cidi. 

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

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole