pairs John has n points on the X axis, and their coordinates are (x[i],0),(i=0,1,2,…,n−1). He wants to know how many pairs<a,b> that |x[b]−x[a]|≤k.(a<b) The first line contains a single integer T (about 5), indicating the number of cases. Each test case begins with two integers n,k(1≤n≤1000...