This problem is in Contest(s) below:
Contest 1035:컴퓨터알고리즘 중간 과제용 콘테스트
Contest 1036:2022학년도 2학기 프로그래그래밍실습II 중간고사 콘테스트