VK Cup 2017

来源:互联网 发布:谁用过淘宝牙齿矫正器 编辑:程序博客网 时间:2024/03/29 09:58

C. Maximum Number
time limit per test1 second
memory limit per test256 megabytes
inputstandard input
outputstandard output
Stepan has the newest electronic device with a display. Different digits can be shown on it. Each digit is shown on a seven-section indicator like it is shown on the picture below.

So, for example, to show the digit 3 on the display, 5 sections must be highlighted; and for the digit 6, 6 sections must be highlighted.

The battery of the newest device allows to highlight at most n sections on the display.

Stepan wants to know the maximum possible integer number which can be shown on the display of his newest device. Your task is to determine this number. Note that this number must not contain leading zeros. Assume that the size of the display is enough to show any integer.

Input
The first line contains the integer n (2 ≤ n ≤ 100 000) — the maximum number of sections which can be highlighted on the display.

Output
Print the maximum integer which can be shown on the display of Stepan’s newest device.

Examples
input
2
output
1
input
3
output
7

#include <iostream>#include <stdio.h>using namespace std;int main(){    int n;    scanf("%d",&n);    if(n%2)    {        printf("7");        n-=3;    }    while(n)    {        printf("1");        n-=2;    }    return 0;}
0 0
原创粉丝点击