You are writing a program that reads a play-by-play description of a volleyball game and produces a statistics report for one team.
Your program reads a sequence of input lines, each describing one play. Table 1 lists the play types.
| Key | Play | Description |
|---|---|---|
| C | CHECKIN | Marks the start of a new game. Every game begins with exactly one CHECKIN line that lists all players from one team who take part in that game. |
| H | HIT | A hit that the opponent successfully defended. |
| K | KILL | A hit that the opponent failed to defend. |
| E | ERR | An erroneous hit that went into the net or out of bounds. |
| B | BLOCK | A successful defense of a hit at the net. |
| D | DIG | A successful defense of a hit behind the net. |
| R | REPORT | Tells your program to print a report. After printing it, discard every play collected so far and keep processing the rest of the input from a clean state. |
Table 1: Plays
Every play except CHECKIN and REPORT carries exactly one 2-digit player number. Each digit of a player number is between 0 and 5, so a referee can signal it with 0 to 5 fingers on each hand.
For each report, compute the statistics in Table 2 for every player who took part in at least one game, and the same statistics for the whole team.
| Label | Formula | Description | Sample |
|---|---|---|---|
| Hit % | (sum(KILL) - sum(ERR)) / (sum(KILL) + sum(ERR) + sum(HIT)) | Hitting percentage | 0.461 |
| KPG | sum(KILL) / #Games | Kills per game | 5.613 |
| BPG | sum(BLOCK) / #Games | Blocks per game | 3.100 |
| DPG | sum(DIG) / #Games | Digs per game | 2.050 |
Table 2: Statistics
Clarifications:
Each input line contains exactly one play. Column 1 holds one of the play keys from Table 1.
R.Each time you read a REPORT, print a report.
The first two lines of every report are exactly these (the second line is 41 dashes):
Player Hit Pct KPG BPG DPG
-----------------------------------------
Then print one line per player who took part in at least one game, in ascending order of player number, formatted like this:
55 s0.000 99.999 99.999 99.999
s is the sign of the hitting percentage: + when the hitting percentage is >= 0.000, and - otherwise. All four values are printed with exactly three digits after the decimal point.
After the player lines, print one team line in the same format, using the literal label team:
team s0.000 99.999 99.999 99.999
Field layout: the player number (or the label team) is left-justified in an 8-character field; the signed hitting percentage occupies the next 6 characters; and KPG, BPG, and DPG are each right-justified in a 9-character field. No statistic ever exceeds 99.999 in magnitude.
Separate two consecutive reports with a single blank line, and do not print a blank line after the final report.