Question: Programmers from around the world have gathered in a unique code sprint festival In the festival, the participating programmers get a chance to write code
Programmers from around the world have gathered in a unique code sprint festival In the festival, the participating programmers get a chance to write code for tech giants from around the world, and earn some welldeserved cash in the process Different companies have declared various offers for the programmers, and the offers are of the type, code for us for a maximum of X hours, and earn Y takas for each hour you code For instance, if a company offers 8000 takas for each hour of programming, and allows you to code for them for a maximum of 5 hours, you may decide to work for them for 4 hours and earn 32,000 takas in the process You are participating in the festival Naturally, you want to earn as much money as possible You collect information about the rates offered by all the companies, and the maximum number of hours they will allow you to code The festival will run for 8 hours, and you cannot code for the companies before the festival starts or after it ends Describe which algorithm can help you determine which companies you should code for, and for how many hours you should code for each of them in order to maximize your profit
Step by Step Solution
3.42 Rating (146 Votes )
There are 3 Steps involved in it
The above question can be solved using fractional knapsack problem There is a slight change in the a... View full answer
Get step-by-step solutions from verified subject matter experts
