block u to impede v is an arrangement u=x0→x1→x2→⋯→xk=v, where there is a street from block xi−1 to obstruct xi for each 1≤i≤k. The length of a way is the amount of lengths over all streets in the way. Two ways x0→x1→⋯→xk and y0→y1→⋯→yl are unique, if k≠l or xi≠yi for some 0≤i≤min{k,l}.    Subsequent to moving to another city, Homer just recollects the two unique numbers L and R yet fails to remember the numbers

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. Computer science.

 

 way from block u to impede v is an arrangement u=x0→x1→x2→⋯→xk=v, where there is a street from block xi−1 to obstruct xi for each 1≤i≤k. The length of a way is the amount of lengths over all streets in the way. Two ways x0→x1→⋯→xk and y0→y1→⋯→yl are unique, if k≠l or xi≠yi for some 0≤i≤min{k,l}. 

 

Subsequent to moving to another city, Homer just recollects the two unique numbers L and R yet fails to remember the numbers n and m of squares and streets, separately, and how squares are associated by streets. Be that as it may, he accepts the number of squares ought to be no bigger than 32 (on the grounds that the city was little). 

 

As the dearest companion of Homer, if it's not too much trouble, let him know whether it is feasible to view as a (L,R)- constant city or not. 

 

Input 

 

The single line contains two integers L and R (1≤L≤R≤106). 

 

Output 

 

In case it is difficult to track down a (L,R)- ceaseless city inside 32 squares, print "NO" in a solitary line. 

 

In any case, print "YES" in the primary line followed by a depiction of a (L,R)- ceaseless city. 

 

The subsequent line ought to contain two integers n (2≤n≤32) and m (1≤m≤n(n−1)2), where n signifies the number of squares and m means the number of streets. 

 

Then, at that point, m lines follow. The I-th of the m lines ought to contain three integers simulated intelligence, bi (1≤ai<bi≤n) and ci (1≤ci≤106) showing that there is a guided street from block computer based intelligence to impede bi of length ci.

 

 

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Topological Sort
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