#C8591. Split Into Increasing Sequence

    ID: 52590 Type: Default 1000ms 256MiB

Split Into Increasing Sequence

Split Into Increasing Sequence

Given a string s consisting only of digits, determine whether it is possible to split it into two or more non-empty substrings such that each substring represents a number and these numbers form a strictly increasing sequence. In other words, if the string s is divided into numbers a1, a2, ..., an with n \ge 2, then they must satisfy the equation

$$a_{i+1} = a_i + 1$$

Your task is to write a program that reads the input string from stdin and prints True to stdout if such a split exists, and False otherwise.

inputFormat

A single line containing a string s of digits.

outputFormat

Print True if the string can be split into a strictly increasing sequence of numbers (with each consecutive number being exactly 1 greater than the previous one), or False otherwise.## sample

1234
True

</p>