Expect the unexpected

0

0 votes
Easy
Problem

You are given N dice each of M faces . You have to print the expected value of sum of outcome when all N dice are thrown at once. Numbers on the dice are of the form x , x+1 , x+2 , ..... x+M-1.

Input:
First line of input is N and M.
Second line of input contains N space separated integer each representing x (start number on dice).

Output:
Print the expected value of sum of outcome.

Notes: Print your answer upto 6 decimal place.
Constraints:
1 <= N <= 105
1 <= X <= 105
1 <= M <= 10

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

asf

Editor Image

?