Psuedobinary Numbers
Easy Accuracy: 37.67% Submissions: 146 Points: 2

You are given a number N, you have to represent this number as sum of minimum number of possible psuedobinary numbers. A number is said to be psuedobinary number if its decimal number consists of only two digits (0 and 1)

Examples:

Input       : 31
Output      : 11 10 10
Explanation : 31 can be represented as sum of
              minimum 3 psuedobinary numbers as 11+10+10 

 
Input : 
The first line of input contains an integer T denoting the Test cases. Then T test cases follow. Second line contains number N

Output : 
N as sum of minimum number of possible psuedobinary numbers

Constraints :
1 ≤ T ≤ 50
1 ≤ N ≤ 106

Examples:
Input : 
2
44
100

Output : 
11 11 11 11
100

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.