UVA onlinejudge Problem 100