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 (

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education