582 div2 500 pt problem