CF514A.Chewbaсca and Number

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Luke Skywalker gave Chewbacca an integer number xx . Chewbacca isn't good at numbers but he loves inverting digits in them. Inverting digit tt means replacing it with digit 9t9-t .

Help Chewbacca to transform the initial number xx to the minimum possible positive number by inverting some (possibly, zero) digits. The decimal representation of the final number shouldn't start with a zero.

输入格式

The first line contains a single integer xx (1<=x<=1018)(1<=x<=10^{18}) — the number that Luke Skywalker gave to Chewbacca.

输出格式

Print the minimum possible positive number that Chewbacca can obtain after inverting some digits. The number shouldn't contain leading zeroes.

输入输出样例

  • 输入#1

    27
    

    输出#1

    22
    
  • 输入#2

    4545
    

    输出#2

    4444
    
首页