BETA

Difficulty Level: Easy

Submissions: 250 Accuracy:

62%

Element in a Series
       

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

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

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