861 not working
first correct solution
time limit exceeded (also added flags to Makefile)