#K79737. Analyze Running Performance
Analyze Running Performance
Analyze Running Performance
You are given the running records of an athlete for n days. For each day, a distance (in kilometers) is recorded. You are also given a threshold value T (in kilometers).
Your task is to compute the following three values:
- The maximum distance run over the n days, i.e., \(\max_{1 \leq i \leq n}{d_i}\).
- The total distance of all days where the distance is strictly greater than \(T\), i.e., \(\sum_{d_i > T} d_i\).
- The number of days on which the athlete did not run (i.e., distance equals 0).
If n is 0, then the maximum and total distances are considered to be 0.0
and the number of non-running days is 0
.
inputFormat
The input is given via standard input (stdin) in the following format:
- A single integer n representing the number of days.
- If n > 0, a line containing n space-separated floating-point numbers representing the distances for each day.
- A floating-point number T representing the threshold distance.
outputFormat
Output to standard output (stdout) a single line containing three values separated by spaces:
- The maximum distance (a floating-point number).
- The total distance of days with distance strictly greater than T (a floating-point number).
- The number of days with a distance of 0 (an integer).
Make sure that the floating-point numbers are printed in decimal form (e.g., 10.5, 0.0).## sample
7
5.0 10.5 0.0 3.2 6.3 8.1 0.0
5.0
10.5 24.9 2