Added Problem 10 in Prolog