HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Problems from everywhere > problem:


50561 - Lucky tickets

Guest
• Discussion of problem (3)

Volume problems

• 50670 - Picture
• 50612 - Fun game
• 50621 - Postal Figures
• 50630 - Radio Station
• 50631 - Robots
• KBH-1012. 50617 - KBH
• KBH-1013. 50618 - Code Correction
• VologdaInterUni-D. 50610 - Feasibility
• 50561 - Lucky tickets
• 50590 - Bronze medalists
• 50604 - Viruses
• 50611 - Maximum of the minima
• 50642 - Draft board
• 50665 - Intersecting rectangles
• TopCoder-6. 50759 - Text Statistics
• TopCoder-7. 50244 - Chessboard P...
• VologdaInterCity-A. 50614 - Numbe...

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 Input 2
11111110
11111112
10000000
99999999
Output 1 Output 2
1
4379055

Для отправки решений необходимо выполнить вход.

www.contester.ru