CS 1025 Computer Science Fundamentals I
Assignment 5

Department of Computer Science
University of Western Ontario
Given: November 21, 2011
Due: November 30, 2011

This assignment is out of 60 points.


Introduction

This assignment gives you the opportunity to try problems from this year's regional competition in the ACM Inter-Collegiate Programming Contest. The problem set is available here. There were 9 problems and the teams had 5 hours to solve them. One team solved all 9 problems and some teams didn't solve any. The problems that were solved most often were C, D and I. During the contest, the teams' solutions are tested automatically using test input files that the teams cannot see.

During the contest, programs are evaluated soley on whether they give the correct output in the time allowed. For this assighment, however, program organization and clarity and documentation will count.

Question 1. Solve Problem D from the problem set (60 points)

You must provide your own solution to the problem, as well as documentation describing what the parts do and how they work. A test input file is given here and the correct output is given here. Your program should read the input data from System.in and write its output on System.out.

Question 2 (Bonus). Solve problem C from the problem set (60 points)

You must provide your own solution to the problem, as well as documentation describing what the parts do and how they work. A test input file is given here and the correct output is given here.