class Solution {
public int gcd(int a, int b) {
return (b != 0) ? gcd(b, a % b) : a;
}
public boolean canMeasureWater(int a, int b, int c) {
if(c > a + b) return false;
return (c == 0) || c % gcd(a, b) == 0;
}
}