#P10732. [NOISG 2019 Prelim] Palindromic FizzBuzz

[NOISG 2019 Prelim] Palindromic FizzBuzz

Background

Translated from NOISG2019 Prelim A.Palindromic FizzBuzz

Problem Description

Given S,ES, E, for every number in the interval [S,E][S, E], if it is not a palindrome, output the number itself; otherwise, output Palindrome!

Input Format

One line with two integers S,ES, E

Output Format

Output a total of ES+1E - S + 1 lines. Each line contains one output. See the Description for the output rules。

8 13
Palindrome!
Palindrome!
10
Palindrome!
12
13
3 3
Palindrome!
999999997 1000000000 
999999997
999999998
Palindrome!
1000000000

Hint

Sample #1 Explanation

8,9,118, 9, 11 are all palindromes, so output Palindrome!

Sample #2 Explanation

33 is a palindrome。

Constraints

For convenience, let xx satisfy 1SEx1 \leq S \leq E \leq x

Subtask\text{Subtask} Score xx Special property
00 - Sample
11 77 99 S=ES = E
22 1111 None
33 1414 100100
44 88 10510^5
55 99 10910^9 S=ES = E
66 2020 None
77 3131 101810^{18}

For 100%100\% of the testdata, 1SE10181 \leq S \leq E \leq 10^{18}, and ES+1105E - S + 1 \leq 10^5

Translated by ChatGPT 5