gcj 2008 Round 1A Problem B