Why is the beginning and end of the colors array padded with zeroes, and why do they affect the implementation?
colors
http://www.usaco.org/current/data/sol_art2_gold_open17.html