Problem 53 in C

Using gmp :(