Facebook Hacker Cup 13 Round 1 Problem