#include #include #include #include #define ull unsigned long long #define ll long long #define d double using namespace std; const int maxn=100233,modd=998244353; struct zs{ll l,r;}b[maxn]; ll a[maxn]; int i,j,k,n,m; ll L,R; ll ra;char rx; inline ll read(){ rx=getchar(),ra=0; while(rx<'0'||rx>'9')rx=getchar(); while(rx>='0'&&rx<='9')ra*=10,ra+=rx-48,rx=getchar();return ra; } bool cmp(zs a,zs b){ return a.lb.r); } int main(){ for(int t=read();t;t--){ n=read(),L=read(),R=read(); for(i=1;i<=n;i++)a[i]=read();sort(a+1,a+1+n); for(i=2;i<=n;i++)b[i-1].l=a[i]-a[i-1]+1,b[i-1].r=a[i]+a[i-1]-1; b[n].l=2e18; sort(b+1,b+1+n,cmp); // for(i=1;i<=n;i++)printf(" %lld--%lld\n",b[i].l,b[i].r); ll mxr=0,l1,r1,ans=0; for(i=1;i<=n;i++){ if(b[i].l>mxr+1){ l1=mxr+1,r1=b[i].l-1;//printf(" %lld %lld\n",l1,r1); if(!(r1R)) ans+=min(R,r1)-max(L,l1)+1; } if(b[i].r>mxr)mxr=b[i].r; }printf("%I64d\n",ans); } }