Feedback | If you notice incorrect translations in Contester, please let author know.
|
|
Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Difficulty Alpha
There is a strip of tickets with numbers of 8 digits. The first ticket has
number M , the last - N . Magnitude M and N
meet the following relationship: 10000000 ≤ M < N
≤ 99999999. You are required to determine the number of "lucky" ticket
between the given numbers. A ticket is considered "lucky" if the sum of the first four
digits equals the sum of the last four digits.
Input
Input contains line numbers of the first and
the last ticket in the tape.
Output
Necessary to derive the required number of "Lucky"
tickets in the tape.
input 1
Td>
|
Input 2
Td> tr> |
11111110
11111112
Td>
|
10000000
99999999
Td> tr> |
Output 1
Td>
|
Output 2
Td> |
1
Td>
|
4379055
Td> |
Для отправки решений необходимо выполнить вход.
|