solutions for programming contests problems