Determine the number

2.8

39 votes
Dynamic Programming, DigitDP, Math Basic, Algorithms, Binary Search, Counting and Arrangements, Easy., Math
Problem

You are given T test cases. Your task is to determine the nth '100 sum' number corresponding to each test case.

Note: A '100 sum' number is defined as a number whose sum of all digit is equal to 100.

Input format

  • First line: Single integer T denoting the number of test cases
  • Next T lines: Single integer N representing the nth 100 sum number

Output format

For each test case, print a single integer in a new line that contains the correct answer.

Constraints

1T1001N1e10

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

First 100sum number is "199999999999" . You can check by taking the sum.

 

Editor Image

?