CF1202D.Print a 1337-string...

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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 nn .

You have to find a sequence ss consisting of digits {1,3,7}\{1, 3, 7\} such that it has exactly nn subsequences equal to 13371337 .

For example, sequence 337133377337133377 has 66 subsequences equal to 13371337 :

  1. 337133377337\underline{1}3\underline{3}\underline{3}7\underline{7} (you can remove the second and fifth characters);
  2. 337133377337\underline{1}\underline{3}3\underline{3}7\underline{7} (you can remove the third and fifth characters);
  3. 337133377337\underline{1}\underline{3}\underline{3}37\underline{7} (you can remove the fourth and fifth characters);
  4. 337133377337\underline{1}3\underline{3}\underline{3}\underline{7}7 (you can remove the second and sixth characters);
  5. 337133377337\underline{1}\underline{3}3\underline{3}\underline{7}7 (you can remove the third and sixth characters);
  6. 337133377337\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 ss must not exceed 10510^5 .

You have to answer tt independent queries.

输入格式

The first line contains one integer tt ( 1t101 \le t \le 10 ) — the number of queries.

Next tt lines contains a description of queries: the ii -th line contains one integer nin_i ( 1ni1091 \le n_i \le 10^9 ).

输出格式

For the ii -th query print one string sis_i ( 1si1051 \le |s_i| \le 10^5 ) consisting of digits {1,3,7}\{1, 3, 7\} . String sis_i must have exactly nin_i subsequences 13371337 . If there are multiple such strings, print any of them.

输入输出样例

  • 输入#1

    2
    6
    1
    

    输出#1

    113337
    1337
首页