drew a shut polyline on a plane, that comprised distinctly of vertical and even sections (corresponding to the arrange tomahawks). The sections switched back and forth among flat and vertical ones (an even fragment was constantly trailed by an upward one, as well as the other way around). The polyline didn't contain severe self-convergences, which implies that in the event that any two fragments shared a typical point, that point was an endpoint for

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

Correct answer will be upvoted else Multiple Downvoted. Don't submit random answer. Computer science.

One drew a shut polyline on a plane, that comprised distinctly of vertical and even sections (corresponding to the arrange tomahawks). The sections switched back and forth among flat and vertical ones (an even fragment was constantly trailed by an upward one, as well as the other way around). The polyline didn't contain severe self-convergences, which implies that in the event that any two fragments shared a typical point, that point was an endpoint for the two of them (kindly counsel the models in the notes area). 

 

Sadly, the polyline was deleted, and you just know the lengths of the horizonal and vertical portions. Kindly develop any polyline coordinating with the portrayal with such sections, or establish that it doesn't exist. 

 

Input 

 

The primary line contains one integer t (1≤t≤200) — the number of experiments. 

 

The primary line of each experiment contains one integer h (1≤h≤1000) — the number of even fragments. The accompanying line contains h integers l1,l2,… ,lh (1≤li≤1000) — lengths of the even fragments of the polyline, in discretionary request. 

 

The accompanying line contains an integer v (1≤v≤1000) — the number of vertical portions, which is trailed by a line containing v integers p1,p2,… ,pv (1≤pi≤1000) — lengths of the upward sections of the polyline, in subjective request. 

 

Experiments are isolated by a clear line, and the amount of qualities h+v over all experiments doesn't surpass 1000. 

 

Output 

 

For each experiment output Yes, if there exists something like one polyline fulfilling the prerequisites, or No in any case. In the event that it exists, in the accompanying n lines print the directions of the polyline vertices, arranged by the polyline crossing: the I-th line ought to contain two integers xi and yi — directions of the I-th vertex. 

 

Note that, each polyline fragment should be either level or vertical, and the sections should shift back and forth among flat and vertical. The directions ought not surpass 109 by their outright worth.

 

 

Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Intelligent Machines
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
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