시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB66224820940.980%

문제

맥주를 좋아하는 창영이는 냉장고에 맥주를 보관한다. 일반 냉장고에 음식과 맥주를 함께 보관하다보니 창영이의 냉장고에는 맥주를 넣을 곳이 점점 없어지고 있었다. 창영이는 맥주 전용 냉장고를 만들기로 결심했다.

창영이가 만들 냉장고는 a × b × c 크기의 직육면체이고, n개의 맥주 박스를 보관할 수 있다. 맥주 박스는 크기가 1 × 1 × 1인 정육면체이다. 창영이는 맥주를 신선하게 보관하기 위해서, 냉장고의 겉넓이를 가능한 작게 만들려고 한다.

예를 들어, 냉장고의 용량이 12라면, 다음과 같은 네가지 냉장고를 만들 수 있다.

크기 겉넓이
3 × 2 × 2 32
4 × 3 × 1 38
6 × 2 × 1 40
12 × 1 × 1 50

이 경우에 가장 좋은 냉장고는 3 × 2 × 2이다.

n이 주어졌을 때, 창영이가 만들 가장 좋은 냉장고(겉넓이가 가장 작은 냉장고)의 크기를 구하는 프로그램을 작성하시오.

입력

첫째 줄에 n이 주어진다. (1 ≤ n ≤ 106)

출력

첫째 줄에 a b c를 출력한다. 만약 겉넓이가 가장 작은 냉장고가 여러 가지인 경우, 아무거나 출력한다.

예제 입력 1

12

예제 출력 1

3 2 2

예제 입력 2

13

예제 출력 2

1 13 1

예제 입력 3

1000000

예제 출력 3

100 100 100
W3sicHJvYmxlbV9pZCI6IjM1OTUiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWI5ZTVcdWM4ZmMgXHViMGM5XHVjN2E1XHVhY2UwIiwiZGVzY3JpcHRpb24iOiI8cD5cdWI5ZTVcdWM4ZmNcdWI5N2MgXHVjODhiXHVjNTQ0XHVkNTU4XHViMjk0IFx1Y2MzZFx1YzYwMVx1Yzc3NFx1YjI5NCBcdWIwYzlcdWM3YTVcdWFjZTBcdWM1ZDAgXHViOWU1XHVjOGZjXHViOTdjIFx1YmNmNFx1YWQwMFx1ZDU1Y1x1YjJlNC4gXHVjN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