luogu#P2110. 欢总喊楼记
欢总喊楼记
Background
The Classic of Poetry says: Guan-guan cries the osprey, on the islets in the river. Fair and graceful is the lady; the gentleman seeks a good mate.
It was another summer brushed by the wind... One day, while Huan-zong was studying in the library, he looked up and saw a graceful girl drift past. Truly, with one backward glance she smiled, and a hundred charms were born; the beauty of the six palaces lost their color. A wave of poetry rose in Huan-zong’s heart, and he casually wrote the verse: Ah, you are love, warmth, and hope; you are the April of the human world!
As time slipped by, Huan-zong still could not forget that girl. People say that unrequited love is bitter, yet Huan-zong insisted on it. Night after night he struggled to sleep; could the fair lady know this heart? By chance, he learned some information about the girl. One day, Huan-zong finally gathered his courage and confessed to her!
That night was especially beautiful. Huan-zong spoke passionately downstairs; the mood was romantic and moving. The girl felt a bit touched, but would saying yes right away be a bit lacking in reserve? So, she decided to challenge Huan-zong to see how sincere he really was.
Problem Description
The girl gives two integers and , and she wants Huan-zong to count how many integers satisfy:
- ,
- The most significant and least significant decimal digits of are equal.
For example (ignoring the restriction ), , , qualify, whereas and do not.
Children, Huan-zong’s happiness in his next life depends on your help!
Input Format
One line containing two integers and .
Output Format
One line with a single integer, the number of that satisfy the property.
2 47
12
Hint
Constraints:
For of the testdata, .
For of the testdata, .
Translated by ChatGPT 5