| Krosh Kaliningrad Contest 1 |
|---|
| Finished |
Krosh has the array $$$a$$$ of $$$n$$$ non-negative integers. Help him to calculate the following value:
$$$\sum\limits_{l = 1}^n \sum\limits_{r = l}^n (a(l) $$$ $$$^$$$ $$$a(l + 1) $$$^$$$ $$$... $$$^$$$ $$$a(r)) * max(a(l), a(l + 1), ..., a(r))$$$ (^ - bitwise XOR).
Output the answer modulo $$$10^9+7$$$.
In the first line you are given number $$$1 \le n \le 2 * 10^5$$$ In the next line you are given $$$n$$$ non-negative integers $$$0 \le a_i \le 10^9$$$.
Output the answer modulo $$$10^9+7$$$.
4 10 8 12 1
941
1 1000000000
49
| Name |
|---|


