Updated and modified files to use a template class for Google Code Jam.