#K79737. Analyze Running Performance

    ID: 35375 Type: Default 1000ms 256MiB

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:

  1. A single integer n representing the number of days.
  2. If n > 0, a line containing n space-separated floating-point numbers representing the distances for each day.
  3. A floating-point number T representing the threshold distance.

outputFormat

Output to standard output (stdout) a single line containing three values separated by spaces:

  1. The maximum distance (a floating-point number).
  2. The total distance of days with distance strictly greater than T (a floating-point number).
  3. 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