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