Preparando MOJI

Nearest Interesting Number

1000ms 262144K

Description:

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 \ge a$$$ and $$$n$$$ is minimal.

Input:

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

Output:

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

Sample Input:

432

Sample Output:

435

Sample Input:

99

Sample Output:

103

Sample Input:

237

Sample Output:

237

Sample Input:

42

Sample Output:

44

Informação

Codeforces

Provedor Codeforces

Código CF1183A

Tags

implementation

Submetido 0

BOUA! 0

Taxa de BOUA's 0%

Datas 09/05/2023 09:49:07

Relacionados

Nada ainda