codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

688B.md (1262B)


      1 Source: https://codeforces.com/problemset/problem/688/B
      2 
      3 B. Lovely Palindromes
      4 
      5 time limit per test
      6 
      7 1 second
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 standard input
     16 
     17 output
     18 
     19 standard output
     20 
     21 Pari has a friend who loves palindrome numbers. A palindrome number is a number that reads the same forward or backward. For example 12321, 100001 and 1 are palindrome numbers, while 112 and 1021 are not.
     22 
     23 Pari is trying to love them too, but only very special and gifted people can understand the beauty behind palindrome numbers. Pari loves integers with even length (i.e. the numbers with even number of digits), so she tries to see a lot of big palindrome numbers with even length (like a 2-digit 11 or 6-digit 122221), so maybe she could see something in them.
     24 
     25 Now Pari asks you to write a program that gets a huge integer *n* from the input and tells what is the *n*-th even-length positive palindrome number?
     26 
     27 Input
     28 
     29 The only line of the input contains a single integer *n* (1 ≤ *n* ≤ 10100 000).
     30 
     31 Output
     32 
     33 Print the *n*-th even-length palindrome number.
     34 
     35 Examples
     36 
     37 Input
     38 
     39 ```
     40 1
     41 ```
     42 
     43 Output
     44 
     45 ```
     46 11
     47 ```
     48 
     49 Input
     50 
     51 ```
     52 10
     53 ```
     54 
     55 Output
     56 
     57 ```
     58 1001
     59 ```
     60 
     61 Note
     62 
     63 The first 10 even-length palindrome numbers are 11, 22, 33, ... , 88, 99 and 1001.