This problem is in Contest(s) below:
Contest 1029:2019년도 1학기 자바프로그래밍 실습시험
Contest 1053:C++프로그래밍 2021년도 1학기 4장 문제