题目
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define fi first
#define se second
#define lson p << 1
#define rson p << 1 | 1
const int maxn = 1e6 + 5, inf = 1e18 + 5, maxm = 4e4 + 5, mod = 1e9 + 7, N = 1e6;
int a[maxn], b[maxn];
bool vis[maxn];
int n, m;
string s;
struct Seg{int l, r;
};
vector<Seg> seg;
int mx[maxn];void solve(){int res = 0;int x, q, k;// string s, t;cin >> n >> m;seg.clear();seg.pb({0, 0});int mn = inf;int min_len = inf;res = 0;for(int i = 1; i <= n; i++){int l, r;cin >> l >> r;seg.pb({l, r});min_len = min(min_len, r - l + 1);}sort(seg.begi