Take a quick look at this problem.
According to the given definitions of the functions, doesn't it make f(x,y) = gcd(x,y)?!
I can't think of why it's not true but the solution using this assumption is giving wrong answer.
I think I am missing something but I don't know what it is..