Problem
Input format
The first line contains the natural number `t`. The following lines contain `t` natural numbers. - `1 <= t <= 100` - `0 <= x <= 1.000.000.000` - the subprogram `sc` must be recursive and must not use repetitive statements - the subprogram `radacina` may be recursive or iterative, but must call the subprogram `sc`
Output format
The program prints `t` lines, each containing two natural numbers separated by a space: the digit sum of `x` and the digital root of `x`, in reading order.
Example
3 9875 10000 7
29 2 1 1 7 7
Stuck?
Use the Get Hint button in the action bar to reveal a guided hint.
💬 Discussion
Loading...No comments yet. Be the first to start the discussion!
Sample cases (from the problem)
Sample Case 1
3 9875 10000 7
29 2 1 1 7 7
Solve it your way first
Community solutions unlock after you submit a passing solution. Don't peek.
Ready to solve this challenge?
Create a free account to write code, submit solutions, and track your progress.