Solved problem C. Fair and Square for small input only