{"raw_statement":[{"iden":"problem statement","content":"Given are $N$ pairwise distinct non-negative integers $A_1,A_2,\\ldots,A_N$. Find the number of ways to choose a set of between $1$ and $K$ numbers (inclusive) from the given numbers so that the following two conditions are satisfied:\n\n*   The bitwise AND of the chosen numbers is $S$.\n*   The bitwise OR of the chosen numbers is $T$."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 50$\n*   $1 \\leq K \\leq N$\n*   $0 \\leq A_i < 2^{18}$\n*   $0 \\leq S < 2^{18}$\n*   $0 \\leq T < 2^{18}$\n*   $A_i \\neq A_j$ ($1 \\leq i < j \\leq N$)"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $K$ $S$ $T$\n$A_1$ $A_2$ $...$ $A_N$"},{"iden":"sample input 1","content":"3 3 0 3\n1 2 3"},{"iden":"sample output 1","content":"2\n\nThe conditions are satisfied when we choose ${1,2}$ or ${1,2,3}$."},{"iden":"sample input 2","content":"5 3 1 7\n3 4 9 1 5"},{"iden":"sample output 2","content":"2"},{"iden":"sample input 3","content":"5 4 0 15\n3 4 9 1 5"},{"iden":"sample output 3","content":"3"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}