GCJ 2014 Round1A Problem A