kattis problem solutions c++