Type: Default 1000ms 256MiB

回文平方数

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

回文数是指从左向右念和从右像做念都一样的数。如12321就是一个典型的回文数。

给定一个进制B(2<=B<=20十进制),输出所有的大于等于1小于等于300(十进制下)且它的平方用B进制表示时是回文数的数。用’A’,’B’……表示10,11等等。

Input Format

共一行,一个单独的整数B(B用十进制表示)。

Output Format

每行两个数字,第二个数是第一个数的平方,且第二个数是回文数。(注意:这两个数都是B进制)

Sample

input

10

output

1 1
2 4
3 9
11 121
22 484
26 676
101 10201
111 12321
121 14641
202 40804
212 44944
264 69696


Hint

保证2B202 \leq B \leq 20

时间限制:1s1 \text {s}

空间限制:256MB256 \text {MB}

20200820进制问题练习

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
8
Start at
2020-8-20 9:19
End at
2020-8-23 9:19
Duration
72 hour(s)
Host
Partic.
23