Question
A transporter means to venture to every part of the length of the Trans-Canada course from Vancouver to St. John's, a distance of 7000 kilometers,
A transporter means to venture to every part of the length of the Trans-Canada course from Vancouver to St. John's, a distance of 7000 kilometers, remaining at inns consistently en route. The driver has been given a rundown of the areas of OK lodgings, just as the distance between every inn, estimated in kilometers, from the beginning stage in Vancouver, which has been provided to him. There are a couple of lodging places that are incorporated: 0, 990, 1010; 1970; 2030; 2940; 3060; 3930; 4060; 4970; 5030; 5990; 6010; 7000; notwithstanding, other inn destinations might be added just before the excursion begins.
Decide if it is feasible to finish the excursion if the shipping organization necessitates that the driver travel a base distance of A km each day, the law necessitates that the driver travel a greatest distance of B km each day, and the driver is needed to remain in a qualified inn every evening of the excursion (from the above list or the extra areas portrayed underneath).
When making the excursion, the driver is keen on different potential outcomes, and you are entrusted with composing a product that will decide the number of particular choices are accessible to him.
It is difficult to finish the excursion, for instance, if no new inn destinations are added between A = 1 and B = 500. For this situation, there are no other options, and the quantity of conceivable outcomes is zero. In the event that A = 970 and B = 1030, there is just a single technique to finish the excursion; notwithstanding, if A = 970 and B = 1040, there are four potential courses to finish the outing. In the event that A = 970, B = 1030, and we add one stop at 4960, there are two potential strategies to finish the excursion.
Info
It is important to know both the most reduced distance An and the greatest distance B (1 A B = 7000), which are the two numbers, in the initial two lines of the information. The third line of the information contains the number N (0 N 20), which is trailed by N lines, every one of which contains the area m of an extra appropriate inn (0 m 7000), as displayed in the model.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started