P27164 [AtCoder] Chirashi Sushi
NOI
题目描述

Problem Description

Iroha wants to eat chirashi sushi.

By the way, let $ f(X) $ be the sum of the digits of a non-negative integer $ X $ when expressed in base 10.

Given an integer $ N $, find the smallest non-negative integer $ X $ that satisfies the following conditions:

  • $ f(X) = f(N) $
  • $X \neq N$

Input Format

A single line contains the positive integer $ N $.

$ N $

Output Format

Output the smallest value of $ X $ that satisfies the conditions.

Sample Input and Output

Sample Input #1

28

Sample Output #1

19

Sample Input #2

12

Sample Output #2

3

Notes/Hints

Constraints

  • $1 \leq N \leq 10^{15}$

Sample Explanation 1

- - - - - - ### Input Example 2 12 ### Output Example 2 3

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
28
样例输出
19