Validation
We advise you to make use of the following solution checking program in order to make sure that you have understood the constraints (and also to check that there are no bugs in your program).
The solution checking problem can be downloaded here or can be accessed below on line.