F. Brass Birmingham: cities
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Today Igor and Ira with their friends Sasha and Lesha decided to play a new board game "Brass Birmingham".

In each round, the players take turns making moves. During the turn, the player can build one industry per city, a road connecting two cities, or perform an action.

To perform an action or build something, each player has $$$K$$$ cards in their hands. There are two types of cards: cards of cities with the name of a certain city, allowing to build any industry in a given city, and cards of industries that allow to build a given industry in any city, to which there is a player's road.

Igor keeps to his strategy and wants to put a steel plant in the city of Birmingham, which has the number 1. In his opinion, if one puts a steel plant in this city, then he wins the game for sure.

According to the rules of the game, all players take turns, this time Igor will go last. In this round, all players can build either one building or a road (they do not want to do actions).

According to the rules, the player can build a building in the city:

1) If a player has a card of the corresponding city, then he plays it and discards it from his hand.

2) If the player has a card with the corresponding industry and there is either a building in this city or the road of this player leading to this city. This card is also played and discarded.

Igor understands that the other players will definitely build a steel plant in Birmingham to stop him if they have the opportunity.

Igor writes down the entire course of the game in his notebook, so he knows which cards have already left the game, as well as he knows how many cards there were originally for each city and each industry.

With what probability will Igor be able to build a steel plant in the city of Birmingham?

Input

The first string contains three integers $$$N$$$, $$$K$$$ and $$$M$$$ $$$(2\leq N \leq 10^3,1\leq K, M \leq 10^3)$$$ — the number of cities in the game, the number of cards in each player's hand, and the number of cards left in the deck.

The second string contains four integers $$$C$$$, $$$R$$$, $$$G$$$, $$$H$$$ $$$(0\leq C + R\leq 4K+M,$$$ $$$ 0\leq G\leq C,$$$ $$$0\leq H\leq R)$$$ — the number of cards remaining in the game with the city of Birmingham, the number of cards remaining in the game with the steel plant, the number of cards with the city of Birmingham in Igor's hand, the number of cards with the steel plant in Igor's hand.

The third string contains 4 integers $$$a_i$$$ $$$(0\leq a_i\leq 1,1\leq i\leq 4)$$$, $$$a_i=0$$$ means that the player $$$i$$$ does not have a road to Birmingham and buildings in this city, otherwise $$$a_i = 1$$$. Igor considers himself the number 1 player.

Output

Print one real number with an accuracy of 4 decimal places — the probability that Igor will be able to build a steel plant in the city of Birmingham.

Examples
Input
5 4 12
3 3 2 2
1 0 0 0
Output
0.50000000
Input
5 4 12
2 2 2 1
0 1 1 1
Output
0.50000000
Input
9 1 20
4 2 0 1
1 1 0 0
Output
0.51835121
Input
3 1 6
1 1 1 0
0 0 1 1
Output
0.77777778