q1 updated

🧩 Syntax:
#include <iostream>
using namespace std;

const int MOD = 1e9 + 7;

int main() {
    int t;
    cin >> t;

    int dummy;
    cin >> dummy; // always 2 as per input format (ignored)

    while (t--) {
        int a, b;
        cin >> a >> b;

        long long count = 0;
        for (int i = a; i <= b; ++i) {
            for (int j = a; j <= b; ++j) {
                if ((i & j) == 0) {
                    count = (count + 1) % MOD;
                }
            }
        }
        cout << count << '\n';
    }

    return 0;
}