#include<bits/stdc++.h>
using namespace std;
int t;
unsigned long long n,k;
int main(){
cin>>t;
for(int i=1;i<=t;i++){
cin>>n>>k;
if(k==0)
{
cout<<1<<endl;
continue;
}
unsigned long long p=n/k,q=floor(n/(k+1.0));
cout<<p-q<<endl;
}
return 0;
}
如果我这种做法,不开ull,就等着WA吧
但我知道,一定是你发现没开ull就WA才来讨论版的[doge]