Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/rekursiya-ikkilik-sanoq-sistemasiga-otkazish

Decimal to binary

Easy 1000 ms 64 MB 30%
Share

You are given a non-negative integer $n$. Using a recursive function, print its representation in the binary numeral system.

Recursive step: the remainder of dividing the number by $2$ is a binary digit, and the recursion continues with the quotient.

The number is divided by two in every call, the remainders are read from the bottom up

Input

One line with one integer $n$ ($0 \le n \le 10^9$).

Output

The binary representation of $n$.

Note

$0 \le n \le 10^9$. If $n = 0$, the output is 0.

Examples

Input #1
13
Output #1
1101
Input #2
0
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.