Please check out the solutions:
From the constraints, you need to be able to read in values of N and K up to 10^{18}.
1 Like
Oh that’s it, just replacing int with long long, then it’s works.
Thanks for helping.
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
// freopen("input.txt", "r", stdin);
int t;
cin>>t;
while (t--) {
long long n, k;
cin>>n>>k;
puts(((n / k) % k != 0) ? "YES" : "NO");
}
return 0;
}
Again thank you <3
1 Like