Knapsack Collection

No attempts yetTime limit4sMemory limit512 MB

Problem

Gerald welcomes the teams arriving for a programming contest at the airport. One of his duties is to stand at the luggage carousel and collect every knapsack the teams bring. Gerald is a lazy person, so he stays at one position of the carousel and waits for bags to pass by so he can pick them up.

The carousel consists of ss luggage slots, numbered in ascending order from 00 to s1s-1. The carousel is cyclic, so slots s1s-1 and 00 lie side by side as well. It turns so that if Gerald stands in front of slot ii at some point in time, he stands in front of slot (i+1)mods(i+1) \bmod s one time unit later.

In the beginning Gerald prepares a huge baggage cart at some slot and stands there to wait for luggage. When a knapsack arrives in front of him, he needs tt time units to take it and put it on the cart. After these tt time units he is ready to pick up another knapsack. As long as knapsacks remain on the carousel, Gerald takes the next one to arrive at his position once he is ready.

Gerald wonders how his choice of position changes the time the task takes. There are ss slots that can appear in front of him after the preparation. Compute the minimum, the maximum, and the average time needed to pick up all knapsacks, taken over those ss slots. Time starts when he has prepared the cart at some slot and ends when he has put the last knapsack on the cart.

Input

The first line contains three integers nn, ss and tt (1n20001 \le n \le 2000, 1s1071 \le s \le 10^7, 1t1071 \le t \le 10^7), where nn is the number of knapsacks to pick up, ss is the number of slots of the carousel, and tt is the number of time units Gerald needs to take one knapsack from the carousel and put it on the cart.

The second line contains nn integers k1,,knk_1, \ldots, k_n (0kis10 \le k_i \le s-1), the slots of the knapsacks.

Several knapsacks may be stacked on top of each other in the same slot, but Gerald still picks up only one knapsack at a time.

Output

Print three lines: the minimum time, the maximum time, and the average time over all ss starting slots.

Print the average as a reduced fraction p/q, where q1q \ge 1 and the greatest common divisor of pp and qq is 11. When the average is an integer, print it with denominator 11, for example 16/1.