Solutions for UVa Online Judge problems