Submitted code for the UVa OJ questions