Sort by

recency

|

66 Discussions

|

  • + 0 comments

    This reminds me of when I was trying to solve a problem with water jugs at home. I was working on a pool issue and needed to figure out the exact water balance for a system. I wish I’d known about Pool Maintenance Phoenix back then. Desert Pool Tech could have helped with their expertise in pool repairs across Phoenix. They’re great with precise measurements and ensuring everything works smoothly, much like solving this jug puzzle. The exact amount of water is key in both scenarios—whether it’s a jug puzzle or pool maintenance!

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