#K15911. Calculate Average Watch Time

    ID: 24462 Type: Default 1000ms 256MiB

Calculate Average Watch Time

Calculate Average Watch Time

You are given a list of non-negative integers representing the watch times of various videos and a non-negative integer threshold. Your task is to compute the average watch time of the videos that have watch times greater than or equal to the threshold. Mathematically, if the set of valid watch times is (W), then the average is given by: (\text{average} = \frac{\sum_{w \in W} w}{|W|}). Round the computed average to two decimal places. If no video meets the threshold, output 0.00.

inputFormat

The input is read from standard input (stdin) and consists of three lines:

  • The first line contains an integer \(n\) representing the number of watch times.
  • The second line contains \(n\) space-separated non-negative integers, each representing a video's watch time.
  • The third line contains a non-negative integer representing the threshold.

outputFormat

Print to standard output (stdout) the average watch time (rounded to two decimal places) of the videos whose watch times are at least the threshold. If no videos meet the threshold, print 0.00.

## sample
5
300 1500 2400 800 4000
1000
2633.33