Mayank is given an array named as K and the size of the array is L , and given a number âTâ such that he has to choose randomly maximum two numbers, X and Y such that 0 <= X < Y< L.
What is the probability that sum{K[X]...K[Y] } <= T }?
Input Format:
The first line will contain two numbers: L and T. L lines follow, each containing one number from the array K.
Output Format:
Output one number P to a maximum of 8 decimal places, the probability that sum{K[X],... k[Y]} <= T}
Constraints:
1 <= N < 100000 0 <= D[i] < 10^7
5 10 4 5 3 7 1
0.6
[4,5,3,7,1]
[4], [5], [3], [7], [1], [4,5], [5,3], [3,7], [7,1]
Out of possible 15.
Thus 9/15 = 0.6
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
No editorial available for this problem.
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor