#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cstdlib>
using namespace std;
typedef long long LL;
const int MAXN = 1e5+5;
struct node
{
LL x, y;
} p[MAXN];
bool cmp(node a, node b)
{
if(a.x == b.x)
return a.y < b.y;
return a.x < b.x;
}
LL a[MAXN];
int main()
{
int T, n;
LL L, R;
scanf("%d",&T);
while(T--)
{
scanf("%d%I64d%I64d",&n,&L,&R);
for(int i=0; i<n; i++)
scanf("%I64d",&a[i]);
sort(a, a+n);
for(int i=0; i<n-1; i++)
{
p[i].x = a[i+1]-a[i]+1;
p[i].y = a[i+1]+a[i]-1;
}
sort(p, p+n-1, cmp);
LL ans = R-L+1, low = 0, high = 0;
for(int i=0; i<n-1; i++)
{
low = max(p[i].x,high+1);
high = max(p[i].y,high);
LL tx = max(L,low),ty=min(R,high);
if(tx <= ty)
ans = ans-(ty-tx+1);
}
cout<<ans<<endl;
}
return 0;
}