You have a collection of old Swedish coins. Every coin has a probability of landing heads (and a probability of landing tails). Consider the following experiment for every subset of : Flip each coin in exactly once, and count the number of heads; you win if this number is odd. Let denote the winning probability of the subset .
Given two real numbers and , and a collection of coins , how many subsets of are such that ?
Input consists of several cases. Every case begins with two real numbers and , followed by , followed by . Assume , and .
For every case, print the number of subsets such that . The input cases have no precision issues.
Please take into account that the result can be larger than .
Input
0.2 0.4 1 0.3 0.4 0.5 1 0.3 0.45 0.71 2 0.7 0.6 0.49 0.51 5 0.5 0.5 0.5 0.5 0.5
Output
1 0 3 31