Question: C++ language please do it by yourself and do not copy from the internet. Even if you copy. Please change some code and rewrite it

C++ language

please do it by yourself and do not copy from the internet. Even if you copy. Please change some code and rewrite it by yourself. Thank you so much for helping me I will give you a thumbs up!!

C++ languageplease do it by yourself and do not copy from theinternet. Even if you copy. Please change some code and rewrite it

Problem H: Poor Trade Advisor Yesterday, you were working on a strange machine found in an old garage (later, you find out it was Dr. Emmett Brown's garage), when you accidentally pushed a button and were sent back in time to 48 BC with only a laptop in your hand! Fortunately, you knew enough Latin to communicate with one of the locals who turned out to be Caesar's trade advisor. The advisor invited you to his house and gave you food. In return, you asked him how you could help him. He answered that recently, Caesar has decided to establish a new province in a high profit region of his empire. The empire is a network of cities connected by bidirectional roads, and each road has a certain profit per annum (PPA) value. The PPA of any given road is calculated by subtracting its annual upkeep cost from its annual revenue. The new province will consist of a connected, non-empty set of roads (and the corresponding cities). The province must also have the highest possible average PPA. Caesar further asked his trade advisor to determine the maximum possible number of cities in such a province. Now, the advisor needs your help to solve this problem, or he is worried that Caesar will put him to the sword. You decide to write a program to solve this problem, but you should remember that your laptop has a limited remaining battery and you must be fast! Input Format Each test case starts with two integers 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!