Solutions to ACM Problem contest