Sort by

recency

|

65 Discussions

|

  • + 0 comments
    def solve(a, b, c):
        if c>a and c>b:
            return 'NO'
        if b>a:
            a^=b
            b^=a
            a^=b
        const=a-b
        i=a
        while i!=0:
            if i==c:
                return 'YES'
            if i>=b:
                i-=b
            else:
                i+=const
        return 'NO'
    
  • + 0 comments

    *My Solution using Python *

    from math import gcd x=int(input("")) for i in range(x): a, b, c = map(int, input().split()) if (c <= max(a, b) and c % gcd(a, b) == 0): print ("YES") else : print ("NO")

  • + 0 comments
    import java.util.Scanner;
    
    public class Solution {
    	public static void main(String[] args) {
    		Scanner sc = new Scanner(System.in);
    
    		int T = sc.nextInt();
    		for (int tc = 0; tc < T; tc++) {
    			int a = sc.nextInt();
    			int b = sc.nextInt();
    			int c = sc.nextInt();
    			System.out.println(solve(a, b, c));
    		}
    
    		sc.close();
    	}
    
    	static String solve(int a, int b, int c) {
    		return (c <= Math.max(a, b) && c % gcd(a, b) == 0) ? "YES" : "NO";
    	}
    
    	static int gcd(int x, int y) {
    		return (y == 0) ? x : gcd(y, x % y);
    	}
    }
    
  • + 0 comments

    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"""

  • + 0 comments
    public static String solve(int a, int b, int c) {
    

    // 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; } }