#K33542. Largest Palindromic Number Smaller Than X

    ID: 25110 Type: Default 1000ms 256MiB

Largest Palindromic Number Smaller Than X

Largest Palindromic Number Smaller Than X

Given a positive integer (x) (with (x>10)), find the largest palindromic number that is smaller than (x).

A palindromic number is a number that reads the same backward as forward. For instance, 121 is palindromic while 123 is not. You are required to implement a solution that efficiently computes the maximum palindromic number less than (x).

inputFormat

The input consists of a single line containing a positive integer (x) (where (x > 10)). The input is provided via standard input (stdin).

outputFormat

Output the largest palindromic number smaller than (x) to standard output (stdout).## sample

123
121

</p>