Solutions to various acm contest problems