[BOJ 15222] nnnnn

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 512M

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

Hsara and Simone like to communicate without anyone else knowing what they’re saying. This time, Simone invented a very sneaky cipher. When she wants to tell Hsara a non-negative number n, she performs the following encryption procedure.</p>

Let d(n) denote the decimal expansion of n. Consider the string x := d(n)n , i.e., the decimal expansion of n concatenated with itself n times. The encryption of n is then the length of x.

As an example, assume Simone wants to encrypt the number 10. Then

x = 10101010101010101010.

The length of x is then 20, which will be the encrypted value of x.

Hsara had no problem writing a decryption algorithm for this procedure. But can you?

입력 형식

The first and only line contains an integer L (0 ≤ L ≤ 10106</sup>), the encrypted value of some non-negative integer n.

출력 형식

Output a single line containing the integer n.

예제 입력

20

예제 출력

10

Comments

There are no comments at the moment.