Special Numbers
Submissions: 4635   Accuracy:

23.11%

  Difficulty: Easy   Marks: 2

A number is a special number if it’s digits only consist 0, 1, 2, 3, 4 or 5.

Given a number n and we have to find n-th Special Number. 

Input:
First line of input contains the number of test cases.

The only line of the test case contains N.

Output:

Print the nth special number.

Constraints:

1<=T<=100

1<=N<=100000


Example:

Sample Input:

2
6
10

Sample Output:

5
13

** For More Input/Output Examples Use 'Expected Output' option **

Author: jain_rishabh


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.