시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 603 360 296 63.656%

문제

창영이는 4와 7로 이루어진 수를 좋아한다. 창영이가 좋아하는 수 중에 K번째 작은 수를 구해 출력하는 프로그램을 작성하시오.

입력

첫째 줄에 K(1<=K<=109)가 주어진다.

출력

첫째 줄에 창영이가 좋아하는 숫자 중 K번째 작은 수를 출력한다.

예제 입력 1

1

예제 출력 1

4

예제 입력 2

2

예제 출력 2

7

예제 입력 3

3

예제 출력 3

44

힌트

W3sicHJvYmxlbV9pZCI6IjI4NzciLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiI0XHVjNjQwIDciLCJkZXNjcmlwdGlvbiI6IjxwPlx1Y2MzZFx1YzYwMVx1Yzc3NFx1YjI5NCA0XHVjNjQwIDdcdWI4NWMgXHVjNzc0XHViOGU4XHVjNWI0XHVjOWM0IFx1YzIxOFx1Yjk3YyBcdWM4OGJcdWM1NDRcdWQ1NWNcdWIyZTQuIFx1Y2MzZFx1YzYwMVx1Yzc3NFx1YWMwMCBcdWM4OGJcdWM1NDRcdWQ1NThcdWIyOTQgXHVjMjE4IFx1YzkxMVx1YzVkMCBLXHViYzg4XHVjOWY4IFx1Yzc5MVx1Yzc0MCBcdWMyMThcdWI5N2MgXHVhZDZjXHVkNTc0IFx1Y2Q5Y1x1YjgyNVx1ZDU1OFx1YjI5NCBcdWQ1MDRcdWI4NWNcdWFkZjhcdWI3YThcdWM3NDQgXHVjNzkxXHVjMTMxXHVkNTU4XHVjMmRjXHVjNjI0LjxcL3A+XHJcbiIsImlucHV0IjoiPHA+XHVjY2FiXHVjOWY4IFx1YzkwNFx1YzVkMCBLKDEmbHQ7PUsmbHQ7PTEwPHN1cD45PFwvc3VwPilcdWFjMDAgXHVjOGZjXHVjNWI0XHVjOWM0XHViMmU0LjxcL3A+XHJcbiIsIm91dHB1dCI6IjxwPlx1Y2NhYlx1YzlmOCBcdWM5MDRcdWM1ZDAgXHVjYzNkXHVjNjAxX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