CF1183A.Nearest Interesting Number

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

Polycarp knows that if the sum of the digits of a number is divisible by 33 , then the number itself is divisible by 33 . He assumes that the numbers, the sum of the digits of which is divisible by 44 , are also somewhat interesting. Thus, he considers a positive integer nn interesting if its sum of digits is divisible by 44 .

Help Polycarp find the nearest larger or equal interesting number for the given number aa . That is, find the interesting number nn such that nan \ge a and nn is minimal.

输入格式

The only line in the input contains an integer aa ( 1a10001 \le a \le 1000 ).

输出格式

Print the nearest greater or equal interesting number for the given number aa . In other words, print the interesting number nn such that nan \ge a and nn is minimal.

输入输出样例

  • 输入#1

    432
    

    输出#1

    435
    
  • 输入#2

    99
    

    输出#2

    103
    
  • 输入#3

    237
    

    输出#3

    237
    
  • 输入#4

    42
    

    输出#4

    44
    
首页