cup Google Code Jam solutions in pure C Compile and run command gcc main.c -o main -lm && ./main Note Code tested on Ubuntu, GCC compiler. For code concise, I am not always free allocated memory.