60pts求助!
查看原帖
60pts求助!
938684
yangqy1919楼主2024/10/13 19:25

rt

#include<bits/stdc++.h>
using namespace std; 
long long t,n,k,ans=0;
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
	cin>>t;
	while(t--){
		cin>>n>>k;
		if(k==0) cout<<1<<endl;
		else{
			long long ls=n/(k+1);
			for(int i=ls+1;;i++)
				if(n/i==k) ans++;
				else break;
			cout<<ans<<endl;
		}
        ans=0;
	}
    return 0;
}
2024/10/13 19:25
加载中...