main.cpp complete, solves both practice inputs correctly