My first java solution for div2 200p problem.