GCJ 2013 round 1C solutions.
Bah, got B large wrong.