Suppose you are provided an even number of people going on an adventure, and there are only two-seated rafts. All rafts are identical, weighing 20kg each. Each person is described by two parameters,...


Suppose you are provided an even number of people going on an adventure, and there are only two-seated rafts. All<br>rafts are identical, weighing 20kg each. Each person is described by two parameters, their strength and weight. The<br>speed of a raft can be calculated as the sum of strengths of both persons sitting in it, divided by the total weight of<br>the loaded. We would like to choose the allocation of people to rafts so as to maximize the speed at which the whole<br>group can travel, assuming that the group travels at the speed of the slowest raft in it. Develop a python code to<br>find the maximum speed of the group which can be achieved by optimally choosing places for each person.<br>Sample Input:<br>4<br>50 50<br>50 60<br>70 100<br>100 60<br>Sample Output:<br>0.8421052590012552<br>

Extracted text: Suppose you are provided an even number of people going on an adventure, and there are only two-seated rafts. All rafts are identical, weighing 20kg each. Each person is described by two parameters, their strength and weight. The speed of a raft can be calculated as the sum of strengths of both persons sitting in it, divided by the total weight of the loaded. We would like to choose the allocation of people to rafts so as to maximize the speed at which the whole group can travel, assuming that the group travels at the speed of the slowest raft in it. Develop a python code to find the maximum speed of the group which can be achieved by optimally choosing places for each person. Sample Input: 4 50 50 50 60 70 100 100 60 Sample Output: 0.8421052590012552

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here