#P6353. [COCI 2007/2008 #3] OKTALNI
[COCI 2007/2008 #3] OKTALNI
Problem Description
You are given a binary number. Please convert it to an octal number.
You can use the following conversion method:
- If the number of bits in the binary number is not divisible by , pad on the left until the length becomes a multiple of .
- Split this binary number into groups of three bits.
- The binary value of each group can be replaced by the digit shown in the table below.

Now complete this procedure and output the final octal result.
Input Format
Input one line containing a binary number.
It is guaranteed that the length does not exceed , and the first bit is .
Output Format
Output one line containing an octal number.
1010
12
11001100
314
Hint
Note
This problem is translated from COCI2007-2008 CONTEST #3 T2 OKTALNI。
Translated by ChatGPT 5