#include #include #include #include #include #include #include #include using namespace std; typedef long long LL; int T; LL n,l,r,a[100005]; LL ans; struct Node { LL l,r; }dq,f[100005]; bool cmp(Node a,Node b) { if (a.l!=b.l) return a.lr) return 0; l=max(a.l,l); r=min(a.r,r); return r-l+1; } int main() { scanf("%d",&T); while (T--) { scanf("%I64d%I64d%I64d",&n,&l,&r); for (int i=1;i<=n;++i) scanf("%I64d",&a[i]); sort(a+1,a+n+1); for (int i=2;i<=n;++i) { f[i-1].l=a[i]-a[i-1]+1; f[i-1].r=a[i]+a[i-1]-1; } sort(f+1,f+n-1+1,cmp); int i=1; ans=0; while (i<=n-1) { dq=f[i]; int j=i+1; while (j<=n-1&&f[j].l<=dq.r) { dq.r=max(f[j].r,dq.r); j++; } ans+=work(dq,l,r); i=j; } ans=r-l+1-ans; printf("%I64d\n",ans); } return 0; }