//#include #include #include #include #include #include #include #include #include #include #include #include #include #define sqr(x) (x)*(x) #define lson (p<<1) #define rson (lson | 1) #define eps 1e-10 #define pii pair #define mk(x,y) make_pair(x,y) using namespace std; typedef long long llg; const int N = 1e5+10; llg a[N]; struct Node { llg l,r; }f[N]; bool cmp(Node x,Node y) { if(x.l == y.l) return x.r > y.r; return x.l < y.l; } int main() { int n,cas; llg l,r; scanf("%d",&cas); while(cas--) { scanf("%d%I64d%I64d",&n,&l,&r); for(int i=0;if[i].r) continue; if(f[i].r>=x) { ans += f[i].r - max(x,f[i].l) + 1LL; x = f[i].r+1LL; } } ans = (r-l+1LL) - ans; cout<