Lottery interest

Compute Kangho's expected balance after C weekly lottery drawings, where each ticket (one per won) is equally likely to win J, and print the exact fraction.

Medium7ProbabilityMathDynamic programmingNo attempts yetTime limit2sMemory limit512 MB

Problem

Fortune Bank pays interest with a lottery instead of computing interest the usual way. The bank spends less money this way, and most customers never notice the difference. The interest works as follows.

Every Friday evening the bank hands each account holder one ticket per won of balance. After all tickets are handed out, the bank draws one of them at random. Every ticket is equally likely to be drawn. The account of the person holding the drawn ticket immediately receives J won.

Kangho has just opened an account at Fortune Bank. Given the number of account holders and their balances, compute the expected balance of Kangho after C weeks.

Input

The first line contains N (1 ≤ N ≤ 50).

The second line contains the balances of the N account holders, separated by spaces. The first value is the balance of Kangho. Every balance is between 0 and 100,000, and at least one balance is greater than 0.

The third line contains J (1 ≤ J ≤ 1,000). The fourth line contains C (1 ≤ C ≤ 1,000).

Output

Print the expected balance of Kangho after C weeks as a fraction in lowest terms. Write it as p/qp/q with q>0q > 0 and the greatest common divisor of pp and qq equal to 1. Print the denominator 1 even when the expected value is an integer. For an expected value of 200, print 200/1.

Hint

Take N = 3, balances (2, 2, 2), J = 1 and C = 2. After the first week the balances become (3, 2, 2), (2, 3, 2) or (2, 2, 3), each with probability 1/3. After the second week the expected balance of Kangho is 24/724/7 starting from (3, 2, 2) and 16/716/7 starting from either of the other two. The average of the three is 8/38/3, so the answer is 8/3.