Skip to content

Learning path · Programming Foundations with Python

Back to lesson · Recursion

k진법으로 바꾸어 출력하기

Unrated
한국어

Language

Contribute a translation
Time limit
1000 ms
Memory limit
256 MB
Submissions
0
Correct
0
Solved by
0
AC rate

Statement

정수 $n$을 $k$진법으로 바꾸어 출력하는 함수 f(n, k)를 재귀 함수로 설계하시오.

Input

첫째 줄에 두 정수 $n$과 $k$가 공백을 사이에 두고 주어진다. ($1 \le n \le 1\,000\,000\,000$, $2 \le k \le 9$)

Output

$n$을 $k$진법으로 나타낸 값을 한 줄에 출력한다.

Examples

Sample input 1
13 2
Sample output 1
1101
Sample input 2
255 8
Sample output 2
377

Tags

No tags yet