#include #include #include #include #include #include using namespace std; const int MAXN = 100010; long long a[MAXN]; vector >vec; int main() { int T; scanf("%d", &T); int n; long long L,R; while(T--) { scanf("%d%I64d%I64d",&n,&L,&R); for(int i = 1;i <= n;i++)scanf("%I64d",&a[i]); sort(a+1,a+n+1); vec.clear(); for(int i = 2;i <= n;i++) { if(a[i]-a[i-1]+1 <= R) vec.push_back(make_pair(a[i]-a[i-1]+1, a[i] + a[i-1] - 1)); } sort(vec.begin(), vec.end()); long long ans = 0; long long now = L; for(int i = 0; i < vec.size();i++) { if (now < vec[i].first) { ans += vec[i].first-now; } now = max(now, vec[i].second+1); if (now > R)break; } if(now <= R) ans += R-now+1; cout<