one kind of inquiry:    Little Dormi picks a hub r (1≤r≤n), and the game expert will answer with an exhibit d1,d2,… ,dn, where di is the length of the most brief way from hub r to I, for all 1≤i≤n.    Furthermore, to make the game out of line challenge Little Dormi the game expert will permit

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

Correct answer will be upvoted else downvoted.

 

game expert just permits him to pose one kind of inquiry: 

 

Little Dormi picks a hub r (1≤r≤n), and the game expert will answer with an exhibit d1,d2,… ,dn, where di is the length of the most brief way from hub r to I, for all 1≤i≤n. 

 

Furthermore, to make the game out of line challenge Little Dormi the game expert will permit all things considered ⌈n2⌉ questions, where ⌈x⌉ signifies the littlest integer more noteworthy than or equivalent to x. 

 

Confronted with the stomach-agitating chance of not having the option to figure the tree, Little Dormi needs your assistance to devise a triumphant methodology! 

 

Note that the game expert makes the tree before the game beginnings, and doesn't transform it during the game. 

 

Input 

 

The principal line of input contains the integer n (2≤n≤2000), the number of hubs in the tree. 

 

You will then, at that point, start communication. 

 

Output 

 

At the point when your program has discovered the tree, first output a line comprising of a solitary "!" followed by n−1 lines each with two space isolated integers an and b, signifying an edge associating hubs an and b (1≤a,b≤n). Whenever you are done, end your program ordinarily following flushing the output stream.

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