Solve with C++. Xiao Ming and Xiao Liang are playing a stone game. At the beginning, Xiao Ming had n piles of stones and Xiao Liang had m piles of stones. And the number of pebbles in each pile is no more than 6.
Now, Ming needs to perform d magic operations. Each magic action randomly selects a pebble from the remaining pile(each pile is selected with equal probability) and removes one pebble from the pile.
If there are no more stones in a heap after one spell, the heap will not be considered the next time a spell is performed.
Now Ming wants to know, after d magic operations, what is the probability that Liang will not have any stones left?
The first line of input contains three integers n,m, and d(1 ≤ n,m ≤ 5; 1 ≤ d ≤ 100).
The next line contains n integers, representing the initial number of pebbles in each pile.
The third row contains m integers representing the initial number of pebbles in each pile. All stones are between 1 and 6(including 1 and 6).
Output after d magic operation, Xiao Liang a pile of stones are not left probability. The result is a four-place decimal.
1 2 2
2
1 1
0.3333