Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define LL long long
- const LL M = 1e9+7;
- LL f(LL x, LL bit)
- {
- x++;
- LL period = 1LL<<(bit+1);
- LL a = ((period/2)%M)*((x/period)%M);
- LL b = x%period - period/2;
- if (b>0) a=(a+b)%M;
- return a;
- }
- int main()
- {
- int t;
- cin>>t;
- while (t--)
- {
- int l, r;
- cin>>l>>r;
- if (l>r) swap(l,r);
- LL ans = 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement