Added solution to UVa 10361.