#P16977. [NWERC 2017] English Restaurant

[NWERC 2017] English Restaurant

Background

From Northwestern Europe Regional Contest (NWERC) 2017 Problem E.

Original problem license: CC BY-SA.

Problem Description

After finding a suitable residence in the Swiss Alps, Robin thought he finally had what it takes to be happy. But every day he woke up feeling that something was missing. Maybe it was the lack of English food in these parts? Spotting a market opportunity and solving his problem at the same time, he teamed up with the famous English chef Jim to open a restaurant nearby. While he has no doubts about Jim's talents as a chef, Robin wants to be sure that opening an English restaurant in the Swiss Alps is a good idea.

Fortunately, as a local, he knows the habits of restaurant customers. At the stroke of each hour, a group of people arrives of size that is uniformly random between 11 and gg people (inclusive). The group finds the smallest completely unoccupied table that fits the group and occupies it. If they can not find such a table, the group leaves with great disappointment. Once seated, a group never leaves until the restaurant closes, as Jim has no difficulty keeping the guests entertained.

As an example, suppose the restaurant has 33 tables of capacities 55, 88 and 99. If groups of sizes 5,105,10 and 33 arrive (in that order), in the end there will be 88 people in the restaurant. The first group occupies the table of capacity 55, the second group leaves and the last group occupies the table of capacity 88.

Robin plans to keep his restaurant open for tt hours in total. In the restaurant business the most important metric is the expected number of people in the restaurant when it closes. Can you help Robin calculate the expected occupancy after tt hours?

Input Format

The input consists of:

  • One line with three integers n,g,tn,g,t (1n1001 \le n \le 100, 1g2001 \leq g \leq 200, 1t1001 \leq t \leq 100), the number of tables in the restaurant, the maximum group size, and the number of hours the restaurant is open.
  • One line with nn integers c1,,cnc_1,\ldots,c_n (1ci2001 \le c_i \le 200 for each ii) giving the capacities of the tables.

Output Format

Output the expected number of people in the restaurant when it closes. Your answer should have an absolute or relative error of at most 10610^{-6}.

3 3 2
1 2 3
3.666666667
4 11 4
10 10 10 10
20.000000000
4 3 3
4 1 3 2
5.888888888888