Before starting this homework, you are recommended to read the extra handout, in order to better understand the meaning of inheritance!
If you are not familiar with partial judge , please read this handout
Niflheimr loves to play mobile games.
Based on his experience, he categorized all mobile game players into 2 categories:
NTDWarrior, who spend a lot of money on games.PoorPlayer, who can't afford to buy items in the cash shop inside the game, unless they sell their kidney(腎) QQ.Similarly, he categorized all mobile games into 2 categories:
GTCGame, which provides shops for NTDWarrior to use cash to buy items inside the game. (GTC stands for game time card)FreeGame, in which there is no cash shop for game players.Now Niflheimr get some information about a few players:
power(for all Player), which means the basic gaming skill the player own.dad_money (for NTDWarrior only), which means how much money the player can get every month from his/her dad. (He/She must have a rich daddy~)kidney(for PoorPlayer only), which is the only way the PoorPlayer can get money for playing GTCGame.Moreover, the winner of each kind of games can be decided by the following rules:
GTCGame
The total_power for each player should be calculated as follow:
NTDWarrior: power + 100 *dad_moneyPoorPlayer: power + 100000 * kidneyFreeGame
total_power for each player is equal to his/her power, i.e. the value of dad_money or kidney are not concerned.For all games, the winner can be decide as follow:
total_power greater than or equal to the difficultyof theGame, then the result of the game is Failed.total_power of two players are the same, the result is Draw.total_power.For each given game and its players, Niflheimr wants to know who will win the game.
Input consists of several testcases.
First line of input is an integer N, indicating # of testcases.
Then N testcases follows. Each testcase consists of three lines:
First line and second line of each testcases are alike, in the following format:
name_type_power_extra, where '_' indicates a space character, and
PoorPlayer , 1 if the player is a NTDWarriorpower of the playerdad_money if the player is NTDWarrior, or kidney if the player is PoorPlayerThe third line contains two integers difficulty and type
difficulty of the gameFreeGame, 1 if the game is GTCGameFor each testcase, print out the result of each game.
See the above description and void print_result(int result_code, string winner) defined within Game class.
You are recommended to utilize void print_result(int result_code, string winner) for output.