#include #include #include #include #include #include #include #include #include using namespace std; typedef long long LL; LL T; LL n,k; LL arr[100010]; LL bin_more(LL x,LL m,LL n) { LL l = m; LL r = n; LL pos = -1; while(l <= r) { LL mid = (l + r) / 2; if(arr[mid] >= x) { r = mid - 1; pos = mid; } else { l = mid + 1; } } return pos; } LL bin_less(LL x,LL m,LL n) { LL l = m; LL r = n; LL pos = -1; while(l <= r) { LL mid = (l + r) / 2; if(arr[mid] <= x) { l = mid + 1; pos = mid; } else { r = mid - 1; } } return pos; } int main() { // freopen("1.txt","r",stdin); scanf("%I64d",&T); while(T --) { scanf("%I64d%I64d",&n,&k); for(int i=0;i