Solution working for small input gcj 2011 QR A

This is a solution to google code jam 2011 qualification round's problem
A.
Contains the actual input and output files that passed the contest.