#include using namespace std; #define fr first #define sc second #define pb push_back typedef long long ll; typedef pairpii; const int inf = 0x3f3f3f3f; const int mod = 1000000007; const double pi = acos(-1.0); const ll INF = 0x3f3f3f3f3f3f3f3f; #define rep(i,x,y) for(auto i=(x);i<=(y);++i) #define dep(i,x,y) for(auto i=(x);i>=(y);--i) const int dx[] = { -1,0,1,0 }, dy[] = { 0,1,0,-1 }; ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll poww(ll a, ll b) { ll s = 1; while (b) { if (b & 1)s = (s * a) % mod; a = (a * a) % mod; b >>= 1; }return s % mod; } /*----------------------------------------------------------------------------------------------------------------------*/ const int N = 1e6 + 11; ll n,m; struct node { ll l,r; bool operator < (const node a) const { return l>n>>k; rep(i,1,n) { cin>>m; z[i].l=m-k; z[i].r=m+k; } sort(z+1,z+n+1); now=z[1].l; rep(i,1,n) { if(now=z[i].l&&now<=z[i].r) { ans++; now++; } } cout<> T; while (T--)solve(); return 0; }