A special number
Practice
3 (29 votes)
Basic programming
C++
Problem
83% Success 9259 Attempts 10 Points 1s Time Limit 256MB Memory 1024 KB 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 \)

 

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...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:10
39 votes
Tags:
ImplementationBasic ProgrammingSortingBasics of Greedy AlgorithmsBasics of Implementation
Points:10
273 votes
Points:10
112 votes
Tags:
Basic ProgrammingBasics of ImplementationImplementation