#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define getmid(l,r) ((l) + ((r) - (l)) / 2) #define MEM(a,b) memset(a,b,sizeof(a)) #define MP(a,b) make_pair(a,b) #define PB push_back #define scan(x) scanf("%d",&x) typedef long long ll; typedef pair pii; const double eps = 1e-8; const int INF = (1 << 30) - 1; const ll mod = 1e9 + 7; const int MAXN = 10000010; const int LOG = 20; int T,n; ll LL,RR; ll A[MAXN]; map mp; pii P[MAXN]; int pcnt; int main(){ scanf("%d",&T); while(T--){ mp.clear(); scanf("%d%I64d%I64d",&n,&LL,&RR); for(int i = 1; i <= n; ++i){ scanf("%I64d",&A[i]); } sort(A + 1,A + n + 1); pcnt = 0; for(int i = 2; i <= n; ++i){ ll L = A[i] - A[i - 1] + 1; ll R = A[i] + A[i - 1] - 1; P[i - 1] = MP(L,R); } sort(P + 1,P + n); int p = 1; for(int i = 2; i < n; ++i){ if(P[i].first > P[p].second) P[++p] = P[i]; else P[p].second = max(P[p].second,P[i].second); } ll ans = RR - LL + 1; for(int i = 1; i <= p; ++i){ ll L = max(LL,P[i].first); ll R = min(RR,P[i].second); if(L > R) continue; ans -= R - L + 1; } printf("%I64d\n",ans); } return 0; }