INUMBER  Interesting number
For the given number n find the minimal positive integer divisable by n, with the sum of digits equal to n.
Input
t – the number of test cases, then t test cases follow. (t <= 50)
Test case description:
n  integer such that 0 < n <= 1000
Output
For each test case output the required number (without leading zeros).
Example
Input: 2 1 10 Output: 1 190
hide comments
VISHAL DEEPAK AWATHARE:
20150219 08:49:57
once you find a way to generate the results we can well do / Last edit: 20150219 08:51:11 

Archit Jain:
20140718 13:09:56
enjoyed solving this 

IKKA:
20140421 16:35:22
how to get accepted using STL 

yousef hadder:
20140331 17:19:23
got AC But with 6.50S,, any suggestions for a faster algorithm ?? 

Kamil:
20140105 19:07:12
What kind of trick do we need to pass memory limit? 

Shafaet:
20121227 09:00:32
@kshitij agrawal: I've used STL and got ac. 

kshitij agrawal:
20111219 11:42:43
Difficult one ..... Don't use STL...


Hy Trường Sơn:
20101020 14:35:11
i think so Last edit: 20101020 14:35:45 

.:: Pratik ::.:
20090731 08:40:40
You don't need big int... 

Drew Saltarelli:
20090712 21:00:43
input : 1000

Added by:  Roman Sol 
Date:  20050113 
Time limit:  7s 
Source limit:  4096B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All 
Resource:  XII team championship of St.Petersburg in programming 