The economy has been pretty bad lately, and it's affecting the village in north pole too...
This year, Santa is afraid not everyone can get a toy on their wishlist. To check if this is the case, Santa uses a small sample of children's wishlists and wants to know how many of them can have at least one item fulfilled in their wishlist with an optimal distribution of toys.
There are different toys that children have put on their wishlist this year. Santa estimates that with his proportion of the sample to real-life population, he currently has enough resources to make units of the -th toy.
Each child has put toys on their wishlist, each a distinct toy between and inclusive.
Santa wants to know the percent of children that can recieve a toy from their wishlist based on his sample. Can you help him?
Constraints
For all subtasks,
Subtask 1 [20%]
Subtask 2 [30%]
Subtask 3 [50%]
No additional constraints.
Input Specification
The first line of input will contain space-separated integers and .
The next lines will first contain , followed by a space, followed by distinct space-separated integers between and , denoting the wishlist for the -th child.
The final line will contain space-separated integers .
Output Specification
Output a number , the percent of children that can recieve a toy from their wishlist in this sample. Outputs with a relative or absolute error of will be accepted.
Sample Input 1
3 2
2 1 2
1 1
1 1
1 2
Sample Output 1
66.6666
Explanation for Sample Output 1
All children want toy and only child wants both toys and . We can give child toy , but since there is only one of toy , We can give either child or toy but not both.
Thus, a maximum of of children can recieve a toy from their wishlist.
Sample Input 2
5 5
2 1 4
2 3 1
1 1
3 2 3 1
1 4
2 1 1 2 100
Sample Output 2
100.0000
Explanation for Sample Output 2
If we give one of toy to child , one of toy to child , one of toy to child , and one of toy each to child and , everyone can recieve a toy, so of children can get toys from their wishlist.
Comments