== include(page="template/taskheader" task_id="dream") ==
Poveste şi cerinţă...
Old Man Ivan, a hard working farmer, tired after a long day of beating the fields, he decided to go to bed.
Being a religious man, he was visited at night by Apostle in a dream. He promised Ivan that his next harvest will be rich, if the farmer is able to help him out with a problem that had been bothering the poor Apostle for a long time.
"Given $K$ and $K$, natural numbers, and $X$ is even, find out the sum of the first $K$ palindromes with $X$ digits".
Because Apostle knows that Old Man Ivan is a mere mortal, he only wants the remainder of this sum when divided by $666013$.
Help Ivan solve the problem.
h2. Date de intrare
Fişierul de intrare $dream.in$ ...
The only line of the input file $dream.in$ consists of two integers, $K$ and $X$.
h2. Date de ieşire
În fişierul de ieşire $dream.out$ ...
The output file $dream.out$ will contain the answer requested by the Apostle.
h2. Restricţii
* $... ≤ ... ≤ ...$
* $1 ≤ K, X ≤ 10^5$
* For tests worth $15$ points, $X$ ≤ 8.
* For tests worth $20$ more points, $X$ ≤ 18.
* For tests worth $35$ more points, $X * K$ ≤ 10^5.
h2. Exemplu
table(example). |_. dream.in |_. dream.out |
| This is some
text written on
multiple lines.
| This is another
text written on
multiple lines.
| 3 4
| 3333
|
h3. Explicaţie
...
The first 3 palindromes with 4 digits are 1001, 1111, 1221. The sum will be 1001 + 1111 + 1221 = 3333.
== include(page="template/taskfooter" task_id="dream") ==