+1(316)4441378

+44-141-628-6690

Pyhton Programming

 

remise:

Adam is so good at playing arcade games that he will win at every game he plays. One fine day as he was walking on the street, he discovers an arcade store that pays real cash for every game that the player wins – however, the store will only pay out once per game. The store has some games for which they will pay winners, and each game has its own completion time and payout rate. Thrilled at the prospect of earning money for his talent, Adam walked into the store only to realize that the store closes in 2 hours (exactly 120 minutes). Knowing that he cannot play all the games in that time, he decides to pick the games that maximize his earnings 

Sample game board at the arcadeGAMECOMPLETION_TIME
(in minutes)PAYOUT_RATEPac-man90400Mortal Kombat1030Super Tetris25100Pump it Up1040Street Fighter II90450Speed Racer1040

An acceptable solution is the one where it still picks the best earnings even when the list of games or completion times or payout rates change. 

Question:
Write code in Java/Scala/Python to help Adam pick the sequence(s) of games that earn him the most money?.

Then, assume you have a variable list of games and their payout rates. What is the best way to pick the games that earn you the most?

Input Explanation

The first line of input is always an integer denoting many lines to read after the first line. In our sample test case, we have 6 in the first line and 6 lines after the first line, each having a game, completion_time and payout_rate. 

In each data line, the game, completion_time and payout_rate are separated by a ‘,'(comma).

The games board may change but the store still closes in 120 minutes. 

Input

6
Pac-man,80,400
Mortal Kombat,10,30
Super Tetris,25,100
Pump it Up,10,40
Street Fighter II,90,450
Speed Racer,10,40

Output Explanation

Print the game names that earn him the most into the standard output in alphabetical order

Output

Mortal Kombat
Pump it Up
Speed Racer
Street Fighter II

Python:

import sys

line = sys.stdin.readline()

print(line)

 

You can place an order similar to this with us. You are assured of an authentic custom paper delivered within the given deadline besides our 24/7 customer support all through.

 

Latest completed orders:

# topic title discipline academic level pages delivered
6
Writer's choice
Business
University
2
1 hour 32 min
7
Wise Approach to
Philosophy
College
2
2 hours 19 min
8
1980's and 1990
History
College
3
2 hours 20 min
9
pick the best topic
Finance
School
2
2 hours 27 min
10
finance for leisure
Finance
University
12
2 hours 36 min
[order_calculator]