Back
Close

Probaception

Statement

 Goal

You are given a list of probabilities (in percent).
Give the probability P to randomly pick a value that is equal to the probability Q to pick this value in the list.

Example: 10 25 50 50
The probability to pick 10 in the list is 25%, Q(10) = 25. not equals
The probability to pick 25 in the list is 25%, Q(25) = 25. equals
The probability to pick 50 in the list is 50%, Q(50) = 50. equals
Thus, the probability to get a value equal to his probability is 75%. P(10 25 50 50) = 75
Input
Line 1 : An integer N for the number of values.
Line 2: The probabilities as integers separated by space.
Output
The probability P.
Constraints
All the probabilities are written in percent.
0 < N < 100
Example
Input
4
10 25 50 50
Output
75

Game modes
Fastest, Shortest

Test cases
Simple 1 Test
Input
4 10 25 50 50
Output
75

Simple 1 Validator
Input
4 50 50 10 25
Output
75

Simple 2 Test
Input
5 15 25 50 15 25
Output
0

Simple 2 Validator
Input
5 25 15 15 50 25
Output
0

All 100 Test
Input
4 100 100 100 100
Output
100

All 100 Validator
Input
8 100 100 100 100 100 100 100 100
Output
100

More numbers Test
Input
10 10 5 20 15 20 25 25 40 25 5
Output
30

More numbers Validator
Input
10 5 10 15 20 20 25 40 25 5 25
Output
30

All the same Test
Input
4 1 1 1 1
Output
0

All the same Validator
Input
7 2 2 2 2 2 2 2
Output
0

Solution language

Solution

Stub generator input