facebook hacker cup 2013-2014 qualification round, bug in C