UVa 12412: Wrong Answer