CF934B.A Prosperous Lot

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

Apart from Nian, there is a daemon named Sui, which terrifies children and causes them to become sick. Parents give their children money wrapped in red packets and put them under the pillow, so that when Sui tries to approach them, it will be driven away by the fairies inside.

Big Banban is hesitating over the amount of money to give out. He considers loops to be lucky since it symbolizes unity and harmony.

He would like to find a positive integer nn not greater than 101810^{18} , such that there are exactly kk loops in the decimal representation of nn , or determine that such nn does not exist.

A loop is a planar area enclosed by lines in the digits' decimal representation written in Arabic numerals. For example, there is one loop in digit 44 , two loops in 88 and no loops in 55 . Refer to the figure below for all exact forms.

输入格式

The first and only line contains an integer kk ( 1<=k<=1061<=k<=10^{6} ) — the desired number of loops.

输出格式

Output an integer — if no such nn exists, output -1; otherwise output any such nn . In the latter case, your output should be a positive decimal integer not exceeding 101810^{18} .

输入输出样例

  • 输入#1

    2
    

    输出#1

    462
  • 输入#2

    6
    

    输出#2

    8080
首页