city has man-made intelligence huge loads of black-top. x huge loads of black-top are spent while fixing a street, and to fix a street among I and j, urban communities I and j should have essentially x huge loads of black-top between them. All in all, if city I had simulated intelligence huge loads of black-top and city j had aj tons, there would remain ai+aj−x tons

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 downvoted.

 

The I-th city has man-made intelligence huge loads of black-top. x huge loads of black-top are spent while fixing a street, and to fix a street among I and j, urban communities I and j should have essentially x huge loads of black-top between them. All in all, if city I had simulated intelligence huge loads of black-top and city j had aj tons, there would remain ai+aj−x tons subsequent to fixing the street between them. Black-top can be moved between urban areas if the street between them is now fixed. 

 

Kindly decide whether it is feasible to associate every one of the urban communities, and assuming this is the case, output any succession of streets to fix. 

 

Input 

 

The principal line contains integers n, m, and x (2≤n≤3⋅105; n−1≤m≤3⋅105; 1≤x≤109) — the number of urban communities, number of streets, and measure of black-top expected to fix one street. 

 

The following line contains n space-isolated integer simulated intelligence (0≤ai≤109) — the measure of black-top at first at city I. 

 

The following m lines contains two integers xi and yi (xi≠yi; 1≤xi,yi≤n) — the urban areas associated by the I-th street. It is ensured that there is all things considered one street between each pair of urban communities, and that the city was initially associated before the seismic tremor. 

 

Output 

 

In case it is unimaginable to expect to associate every one of the urban communities, print NO. In any case, print YES followed by n−1 integers e1,e2,… ,en−1, the request wherein the streets ought to be fixed. ei is the file of the I-th street to fix. In case there are different arrangements, print any.

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Time complexity
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
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