We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Mathematics
- Fundamentals
- Die Hard 3
- Discussions
Die Hard 3
Die Hard 3
Sort by
recency
|
62 Discussions
|
Please Login in order to post a comment
def solve(a, b, c): yes, no = "YES", "NO" a, b = max(a, b), min(a, b)
""" KAIFU KI AAWAAZ BADI MANHOOS HAI ,SUN LO TO AISA LAGEGA MANO JAISE LAKADBAGHGHE KA GALA BAITHA HAI , KAIF KI ID: 2301641530110"""
// char* solve(int a, int b, int c) { int c1=hcf(a,b); if(c<=Math.max(a,b)&&c%c1==0) return "YES"; else return "NO";
} public static int hcf(int n1, int n2) { if (n2 != 0) return hcf(n2, n1 % n2); else return n1; } }
My Python3 solution
I first solved this problem with backtracking (which works great for games, or procedures with limited next steps available), but using the gcd was a lot simpler - I didn't think about it for a while, though. So there are a few ways to solve this problem!