Palindromic Squares
Rob Kolstad
Palindromes are numbers that read the same forwards as backwards. Thenumber 12321 is a typical palindrome.
Given a number base B (2 <= B <= 20 base 10), print all the integersN (1 <= N <= 300 base 10) such that the square of N is palindromic whenexpressed in base B; also print the value of that palindromic square. Use theletters 'A', 'B', and so on to represent the digits 10, 11, and so on.
Print both the number and its square in base B.
PROGRAM NAME: palsquare
INPUT FORMAT
A single line with B, the base (specified in base 10).
SAMPLE INPUT (file palsquare.in)
10
OUTPUT FORMAT
Lines with two i