A special number
Basic programming
C++
83.0% success
10,794 attempts
1s time
256MB memory
1024KB max code
A number \(n\) is said to be special if the sum of its digits is divisible by 4.
For a given integer \(a\), find a number \(n\) such that:
- \(n\) is a special number
- \(n \ge a\)
- \(n\) is minimum possible
Input format
- The first line contains an integer \(T\) denoting the number of test cases.
- For each test case:
- The first line contains an integer \(a\).
Output format
For each test case, print a number \(n\) that satisfies the above conditions in a new line.
Constraints
\(1 \le T \le 10^ 5\)
\(1 \le a \le 10^3\)
Examples
Input
2 432 99
Output
435 103
Explanation
For first test case:
- n = 435, sum of digits is 12 which is divisible by 4.
For second test case:
- n = 103, sum of digits is 4 which is divisible by 4.
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Loading Editor...