Darrell
2011-11-21 20:32:47 UTC
The timing system at the pool gives him a file containing information about
each race. The file contains:
The number of races in the file, on a line by itself.
For each race, there is a line in the file containing the following:
Information about the pool as follows: Whether the Pool is Long course (L)
or Short Corse (S) Whether the Pool is Meters (M) or Yards (Y)
Information about the length of the race, in appropriate units. The shortest
race is 50 yards or meters and the longest race is 1650 yards or meters.
The time (in seconds) for each length of the pool (A length of the pool in a
long corse pool is 50 meters or yards. A length of the pool in a short corse pool
is 25 meters or yards).
The coach would like you to use the times to do some analysis on the races.
Here is the information he would like:
The total length of time it took to swim the race (displayed in minutes
and seconds).
The time for each 50 yards in the race (displayed in minutes and seconds).
For races longer than 100 yards or meters, the time of each multiple of
100 yards or meters.
The fastest 50 yards or meters, by number (1st 50, 2nd 50,etc)
the slowest 50 yards or meters, by number (1st 50, 2nd 50,etc)
the fastest 100 yards or meters, by number (1st 100, 2nd 100,etc)
the slowest 100 yards or meters, by number (1st 100, 2nd 100,etc)
Wheter or not the race was a negative split (was the first half of the race
slower than the second half).
An Example input le appears as follows:
3
LM 200 32.52 34.88 39.22 37.20
SM 100 12.52 14.88 13.22 13.20
SY 50 12.20 12.50
The output produced from the above should be:
Race 1: Long Course 200 Meters:
Total Time: 2:23.82
1st 50m: 32.52
2nd 50m: 34.88
3rd 50m: 39.22
4th 50m: 37.20
1st 100m: 1:07.40
2nd 100m: 1:16.42
Fastest 50: 1st
Slowest 50: 3rd
Fastest 100: 1st
Slowest 100: 2nd
Negative Split: No
Race 2: Short Corse 100 Meters:
Total Time: 53.82
1st 50m: 27.4
2nd 50m: 26.42
1st 100m: 53.82
Fastest 50: 2nd
Slowest 50: 1st
Fastest 100: 1st
Slowest 100: 1st
Negative Split: Yes
Race 3: Short Corse 50 Yards:
Total Time: 24.70
1st 50y: 24.70
Fastest 50: 1st
Slowest 50: 1st
Negative Split: No