Element in a Series
Submissions: 694   Accuracy:

60.23%

  Difficulty: Easy   Marks: 2

Consider a series of numbers composed of only digits 4 and 7 such as 4, 7, 44, 47, 74,...... 44744,.. etc. Given a number n, we need to find n-th number in the series.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains an integer n.

Output:
Print in a new line the nth number in the series.

Constraints:
1<=T<=10^5
1<=N<=1000

Example:

Input:
5
2
3
5
6
11

Output:
7
44
74
77
744

 

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

Contributor: Ayush Govil
Author: Ayush Govil 1


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.