Weekly homework assignments will consist of a number of programming problems, which will appear on this page. You task is to produce a piece of code for each problem, that solves it. The code must be written in C, C++ or Java (see below for compiler specs), must read the problem parameters from standard input (stdin in C, cin in C++, System.in in Java) and print the result to standard output (stdout inC, cout in C++, System.out in Java).
Submission and evaluation
Each problem will contain sample input and output. It is there to clarify any ambiguities in the problem description and for you to test the execution of your code. Once you are reasonably certain that your solution is correct, you will need to submit it to the automatic judge. The judge will run your program on a large set of input cases and tell you how well you did. The judge's reply will be one of:
You can submit solutions as many times as you want, without penalty, until the specified assignment due date. Solutions that receive the "Yes" reply are deemed correct. Incorrect sumbissions will be checked manually for the possibility of part marks.