| Soy Cup #1: Firefly |
|---|
| Закончено |
You're given four integers $$$l$$$, $$$r$$$, $$$y$$$, and $$$k$$$. Calculate:
$$$$$$ \sum_{x=l}^{r}\left(x\oplus y\right)^k\pmod{(10^{9}+7)} $$$$$$
where $$$\oplus$$$ denotes the bitwise XOR operation.
The only line contains four integers $$$l$$$, $$$r$$$, $$$y$$$, and $$$k$$$ ($$$1\le l\le r\le 10^9$$$, $$$1\le y\le 10^9$$$, $$$1\le k\le 10^6$$$).
Output one integer indicating the result of the formula above.
1 10 1 1
55
114 514 1919 810
353713127
| Название |
|---|


