首页 > 其他 > 详细

Educational Codeforces Round 81 (Rated for Div. 2) A Display The Number

时间:2020-01-30 14:06:10      阅读:56      评论:0      收藏:0      [点我收藏+]
A. Display The Number
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You have a large electronic screen which can display up to 998244353998244353 decimal digits. The digits are displayed in the same way as on different electronic alarm clocks: each place for a digit consists of 77 segments which can be turned on and off to compose different digits. The following picture describes how you can display all 1010 decimal digits:

技术分享图片

As you can see, different digits may require different number of segments to be turned on. For example, if you want to display 11, you have to turn on 22 segments of the screen, and if you want to display 88, all 77 segments of some place to display a digit should be turned on.

You want to display a really large integer on the screen. Unfortunately, the screen is bugged: no more than nn segments can be turned on simultaneously. So now you wonder what is the greatest integer that can be displayed by turning on no more than nn segments.

Your program should be able to process tt different test cases.

Input

The first line contains one integer tt (1t1001≤t≤100) — the number of test cases in the input.

Then the test cases follow, each of them is represented by a separate line containing one integer nn (2n1052≤n≤105) — the maximum number of segments that can be turned on in the corresponding testcase.

It is guaranteed that the sum of nn over all test cases in the input does not exceed 105105.

Output

For each test case, print the greatest integer that can be displayed by turning on no more than nn segments of the screen. Note that the answer may not fit in the standard 3232-bit or 6464-bit integral data type.

Educational Codeforces Round 81 (Rated for Div. 2) A Display The Number

原文:https://www.cnblogs.com/hulian425/p/12242644.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!