#P7662. [COCI 2014/2015 #5] ZGODAN
[COCI 2014/2015 #5] ZGODAN
Description
Define a Handsome number: in this positive integer, the parity of any two adjacent digits is different.
Given a positive integer , find the Handsome number closest to . If there are multiple answers, output them in increasing order.
Input Format
A positive integer .
Output Format
The Handsome number(s) closest to .
13
12 14
5801001
5810101
Hint
For of the testdata, .
Translated from COCI 2014/2015 CONTEST #5.
Translated by ChatGPT 5
京公网安备 11011102002149号