Print a 1337-string...
题意翻译
题目描述
$PS:$子序列是能通过删除原序列一些元素并不更改原序列元素位置得到的序列。
给你一个数$n$,求出一个有$n$个子序列为$1337$的序列,序列长度不能大于$10^5$。
举个例子,序列$337133377$有$6$个子序列为$1337$
1. 337**133**3**7**7
1. 337**13**3**37**7
1. 337**1**3**337**7
1. 337**133**37**7**
1. 337**13**3**3**7**7**
1. 337**1**3**33**7**7**
$PS:$加粗为选中的元素
输入格式
第一行为一个整数$t(1≤t≤10)$——询问数。
接下来$t$行每行一个整数$n_i(1≤n_i≤10^9)$
输出格式
共$t$行,每行一个有$n_i$个子序列为$1337$的序列,序列长度不能大于$10^5$。
题目描述
The subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements.
You are given an integer $ n $ .
You have to find a sequence $ s $ consisting of digits $ \{1, 3, 7\} $ such that it has exactly $ n $ subsequences equal to $ 1337 $ .
For example, sequence $ 337133377 $ has $ 6 $ subsequences equal to $ 1337 $ :
1. $ 337\underline{1}3\underline{3}\underline{3}7\underline{7} $ (you can remove the second and fifth characters);
2. $ 337\underline{1}\underline{3}3\underline{3}7\underline{7} $ (you can remove the third and fifth characters);
3. $ 337\underline{1}\underline{3}\underline{3}37\underline{7} $ (you can remove the fourth and fifth characters);
4. $ 337\underline{1}3\underline{3}\underline{3}\underline{7}7 $ (you can remove the second and sixth characters);
5. $ 337\underline{1}\underline{3}3\underline{3}\underline{7}7 $ (you can remove the third and sixth characters);
6. $ 337\underline{1}\underline{3}\underline{3}3\underline{7}7 $ (you can remove the fourth and sixth characters).
Note that the length of the sequence $ s $ must not exceed $ 10^5 $ .
You have to answer $ t $ independent queries.
输入输出格式
输入格式
The first line contains one integer $ t $ ( $ 1 \le t \le 10 $ ) — the number of queries.
Next $ t $ lines contains a description of queries: the $ i $ -th line contains one integer $ n_i $ ( $ 1 \le n_i \le 10^9 $ ).
输出格式
For the $ i $ -th query print one string $ s_i $ ( $ 1 \le |s_i| \le 10^5 $ ) consisting of digits $ \{1, 3, 7\} $ . String $ s_i $ must have exactly $ n_i $ subsequences $ 1337 $ . If there are multiple such strings, print any of them.
输入输出样例
输入样例 #1
2
6
1
输出样例 #1
113337
1337