CF1183A.Nearest Interesting Number
入门
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Polycarp knows that if the sum of the digits of a number is divisible by 3, then the number itself is divisible by 3. He assumes that the numbers, the sum of the digits of which is divisible by 4, are also somewhat interesting. Thus, he considers a positive integer n interesting if its sum of digits is divisible by 4.
Help Polycarp find the nearest larger or equal interesting number for the given number a. That is, find the interesting number n such that n≥a and n is minimal.
Polycarp 知道:如果一个数的各位数字之和能被 3 整除,那么该数本身也能被 3 整除。他进一步认为,各位数字之和能被 4 整除的数也具有某种趣味性。因此,他将一个正整数 n 称为“有趣的数”,当且仅当 n 的各位数字之和能被 4 整除。
请帮助 Polycarp 找到给定数 a 的最近的、不小于 a 的“有趣的数”。即:找出满足 n≥a 且最小的“有趣的数” n。
输入格式
The only line in the input contains an integer a (1≤a≤1000).
输入仅包含一行,其中有一个整数 a(1≤a≤1000)。
输出格式
Print the nearest greater or equal interesting number for the given number a. In other words, print the interesting number n such that n≥a and n is minimal.
输出给定数字 a 的最近的、大于等于 a 的“有趣数”。换言之,输出满足 n≥a 且最小的“有趣数” n。
输入输出样例
输入#1
432
输出#1
435
输入#2
99
输出#2
103
输入#3
237
输出#3
237
输入#4
42
输出#4
44
输入解题思路,AI测评打分。不知道怎么写?