A PGA (Professional Golf Association) Tour event is a golf tournament in which prize money is awarded to the best players. The tournament is broken into four rounds of 18 holes apiece. All players are eligible to play the first two rounds. Only those with the best scores from those 36 holes “make the first cut” to play the final two rounds and qualify for prize money. Players with the best 72-hole aggregate scores (the lowest scores) earn prize money. You must write a program to determine how the total prize money (called the tournament “purse”) is to be allocated for a tournament. Specifications are as follows.
2/3 10) Only the low 70 non-amateur places and ties earn prize money. For example, if 75 players make the 36-hole cut, it is possible for 5 of them not to earn prize money, assuming none of the players making the cut are amateurs. Input The input begins with a single positive integer on a line by itself indicating the number of the cases following, each of them as described below. This line is followed by a blank line, and there is also a blank line between two consecutive inputs. The input for each case is broken into two segments. The amount of the tournament purse and the percentages for all the 70 places are stored in the first segment of the input. This segment contains exactly 71 Line 1: Line 2: Line 3: ... Line71: lines, which are formatted as follows. Total value of the purse Percentage of the purse designated for first place Percentage of the purse designated for second place Percentage of the purse designated for 70-th place All entries in the first 71 file lines can be read as real numbers. All percentages are given to four decimal places. Assume the percentages are correct and sum to 100%. A partial example of the first segment of the input file is shown in the sample input section below. The second segment of the input contains the players’ names and their respective scores for the four rounds. There is a maximum of 144 players.A first line contains the number of players and then one more line for each section). Characters 1–20: Characters 21–23: Characters 24–26: Characters 27–29: Characters 30–32: one of them, with the format as follows (see a partial example in the sample input Player name Round 1 score (first 18 holes) Round 2 score (second 18 holes) Round 3 score (third 18 holes) Round 4 score (fourth 18 holes) Any player who has an asterisk ‘*’ at the end of his last name is an amateur. All players who are not disqualified will have four 18-hole scores listed. (Even though in an actual tournament, players who do not make the cut do not get to play the last two rounds of the tournament, for the purposes of this program all players who are not disqualified will have four 18-hole scores listed.) A player who is disqualified during a round will have a score on that round shown as ‘DQ’. That player will have no additional scores for the tournament. Assume that at least 70 players will make the 36-hole cut. The end of input is denoted by end-of-file. Output For each test case, the output must follow the description below. The outputs of two consecutive cases will be separated by a blank line. Output from this program consists of names of all players who made the 36-hole cut, their finish positions (with the letter ‘T’ after the numeric value representing the finish position if there is a tie for that position, that means two or more NON-AMATEUR players with the same score, and all of them earning money), scores for each round, total scores, and the amounts of money won. Print the money won by a player only if the player gets a prize (even if the prize is $0.00). Disqualified players are listed at the bottom with scores of ‘DQ’ placed in the ‘TOTAL’ column; the order among disqualified players is unimportant. No player who failed to make the 36-hole cut is listed in the output.
WALLY WEDGE HENRY HACKER TOMMY TWO IRON BEN BIRDIE NORMAN NIBLICK* ... LEE THREE WINES JOHNY MELAVO JIMMY ABLE EDDIE EAGLE 1 70 70 2T 77 70 2T 71 72 4 70 74 4 72 72 70 70 70 70 72 72 72 72 72 72 288 $180000.00 $ 88000.00 $ 88000.00 $ 48000.00 $ 2000.00 70 70 70 70 80 DQ 90 99 62 61 69 73 80 DQ Place RDJ RD2 RD3 RD4 TOTAL Money Won 71 99 99 99 98 395 72 99 99 69 73 71 71 99 80 99 396 DQ DQ 280 287 287 288