toshima's solutions for Facebook's hacker cup competition