Overturned Numbers URAL - 2031

Little Pierre was surfing the Internet and came across an interesting puzzle:

Problem illustration

What is the number under the car?

It took some time before Pierre solved the puzzle, but eventually he understood that there were overturned numbers 86, 88, 89, 90, and 91 in the picture and the answer was the number 87.

Now Pierre wants to entertain his friends with similar puzzles. He wants to construct a sequence of n numbers such that its overturning produces a consecutive segment of the positive integers. Pierre intends to use one-digit integers supplemented with a leading zero and two-digit integers only. To avoid ambiguity, note that when the digits 0, 1, and 8 are overturned, they remain the same, the digits 6 and 9 are converted into each other, and the remaining digits become unreadable symbols.

Input

The only line contains the number n of integers in a sequence (1 ≤ n ≤ 99).

Output

If there is no sequence of length n with the above property, output “Glupenky Pierre” (“Silly Pierre” in Russian). Otherwise, output any of such sequences. The numbers in the sequence should be separated with a space.

Example

inputoutput
2
11 01
99
Glupenky Pierre

 

AC代码(其实最多只有四个然后要注意1不能是单纯的1而应该是01所以就应该输出10)

Select Code

#include <iostream>
#include <bits/stdc++.h>
#include <cmath>
using namespace std;

int main()
{
    int n;
    scanf("%d",&n);
    if(n==1)
        printf("10\n");
    else if(n==2)
        printf("11 01\n");
    else if(n==3)
        printf("01 60 80\n");
    else if(n==4)
        printf("11 01 60 80\n");
    else printf("Glupenky Pierre\n");
    return 0;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值