problem_1 in java