my solution for UVaOJ problems