Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std ;
- long long findLCM(long long a, long long b){
- return (a*b)/__gcd(a,b);
- }
- int main(){
- long long t, a, b, k;
- cin >> t ;
- while(t--){
- cin >> a >> b >> k ;
- int lcm = findLCM(a, b);
- int aDivs = MAX_LIMIT / a ;
- int bDivs = MAX_LIMIT / b ;
- int lcmDivs = MAX_LIMIT / lcm ;
- int totalDivs = aDivs + bDivs - lcmDivs ;
- if (totalDivs < k){
- cout << "true" ;
- } else {
- cout << "false";
- }
- }
- return 0 ;
- }
Advertisement
Add Comment
Please, Sign In to add comment