#include #include #include using namespace std; typedef long long ll; const int N=100005; int main() { int t; scanf("%d",&t); while(t--) { int n,k,arr[N],minn,cnt=1; scanf("%d%d",&n,&k); for(int i=0; i=arr[i]-k) { minn++; if(minn<=arr[i]+k) cnt++; } else { minn=arr[i]-k; cnt++; } } } printf("%d\n",cnt); } return 0; }