https://www.acmicpc.net/workbook/view/1152

쉬운문제라고 안함 ㅇㅅㅇ