Random XOR
시간 제한1초메모리 제한256 MB
각 원소를 독립적으로 확률 X/Y로 남길 때, 남은 원소들의 XOR 제곱의 기댓값을 1e9+7로 나눈 나머지를 구한다.
문제
There is an array containing integers. Also, there is initially empty array . Some elements of are going to be added to . Each element is added with probability independently from others. Then the value of is to be computed: where is bitwise exclusive OR (if the array is empty, equals to zero). You are required to compute the expected value of .
입력
The first line of input contains three integers , and . The probability is equal to .
The second line contains integers divided by spaces --- elements of the array .
출력
The answer can be always represented as a fraction where and are co-prime numbers and You are required to output only one number ---