#CF96B. Lucky Numbers (easy)
Lucky Numbers (easy)
CF96B Lucky Numbers (easy)
题目描述
Petya loves lucky numbers. Everybody knows that positive integers are lucky if their decimal representation doesn't contain digits other than and . For example, numbers , , are lucky and , , are not.
Lucky number is super lucky if it's decimal representation contains equal amount of digits and . For example, numbers , , are super lucky and , , are not.
One day Petya came across a positive integer . Help him to find the least super lucky number which is not less than .
输入格式
The only line contains a positive integer ( ). This number doesn't have leading zeroes.
输出格式
Output the least super lucky number that is more than or equal to .
Please, do not use the %lld specificator to read or write 64-bit integers in C++. It is preferred to use the cin, cout streams or the %I64d specificator.
输入输出样例 #1
输入 #1
4500
输出 #1
4747
输入输出样例 #2
输入 #2
47
输出 #2
47
相关
在下列比赛中: