ITRIX_B  Lucky Sequence Again
Lucky Numbers are those numbers made up of prime digits ( 2, 3, 5, 7 ) only . Lucky Numbers contain zero or more copy of these four digits. Lucky sequence is the sequence made of lucky numbers written in ascending order. Print the n^{th} number of the Lucky Sequence.
The first 20 numbers of the lucky sequence will be 2,3,5,7,22,23,25,27,32,33,35,37,52,53,55,57,72,73,75,77…..
Input Format
The First line of the input file contains t which indicate the number of the test cases .Each of the following ‘t’ lines contains an integer ‘n’ .
Constraints
t <= 2000
n <= 10^10 (10 power 10)
Output Format
Output the n^{th} element of the Lucky Sequence (one lucky number per line)
Example
Sample Input: 4 1 3 10 18 Sample Output: 2 5 33 73
hide comments
kamran siddique:
20160409 15:11:20
just switch case is enough ;) so this is in right place..... 

Sue:
20150310 12:34:09
so nice :)) binary search :)) 

Pulkit Singhal:
20140712 10:20:48
Must be a Classical Question


ritz:
20130526 09:31:04
nice question.. but should not be in tutorial i guess... 

:D:
20121116 19:20:17
It's pretty easy. Someone (author or another moderator) decided it belongs in tutorial, so it stays. I only move medium or harder problems to classical and really trivial ones to tutorial. 

Hussain Kara Fallah:
20121116 18:38:21
shouldn't be in tutoria ... Please make it classical


saket diwakar:
20120603 14:04:56
Enjoyed to solve it.:) 

Ajey Golsangi:
20110827 17:24:59
Painful to code the solution. 

neerajcrespo:
20110731 09:26:30
really nice question.. no need of pre


~:
20110624 19:58:58
nice question!!! 
Added by:  Radhakrishnan Venkataramani 
Date:  20110327 
Time limit:  0.653s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Resource:  ITRIX 2011 