```
func canMeasureWater(x int, y int, z int) bool {
if(x+y < z) {return false}
if(x==z || y==z) {return true}
return (z % gcd(x,y)) == 0
}
func gcd(a int, b int) int {
if b == 0 {
return a
} else {
return gcd(b, a%b)
}
}
```