Facebook Hacker Cup Qualification Round Solutions