Answer in python , java c++ only. Correct code and output screenshot required. Else i would downvote.   In this problem, There are 109+7 metropolitan networks coordinated in a circle in this settlement and none of them are related now. Elon Tusk needs to relate a part of those metropolitan networks using only roads of a comparable size to cut down the creation cost of those roads. Because

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Answer in python , java c++ only. Correct code and output screenshot required. Else i would downvote.

 

In this problem, There are 109+7 metropolitan networks coordinated in a circle in this settlement and none of them are related now. Elon Tusk needs to relate a part of those metropolitan networks using only roads of a comparable size to cut down the creation cost of those roads. Because of that he gave a summary on N alludes to where a couple of alludes to can appear more than once and Q questions that you need to answer. For the inquiry you need to choose whether it is attainable to interface all of the metropolitan networks from Li to Ri on that summary using only roads of length Di. 

 

Information 

 

The chief line contains two numbers N and Q (1≤N,Q≤2⋅105 ) — the length of the assortment of metropolitan regions and the amount of requests you need to address. 

 

The ensuing lines contains N numbers addressing the assortment of alludes to. Next Q lines contain three entire numbers L,R and D (1≤Li,Ri≤N, 0≤Di≤109+6) — the extent of metropolitan regions that ought to be related and the length of the road that you can use. 

 

Yield 

 

The yield contains Q lines. On the off chance that it is attainable to interface all of the metropolitan regions from the I-th request can be related with roads of length Di the I-th line should contain "Yes", some other way it should contain "No".

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY