#937
Platinum III
TRESNJA
시간 제한
1s
메모리 제한
64MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Lana lives in a small but merry village. There is a row of cherry trees next to the main street. Lana numbered the trees with consecutive integers starting with 1. After much studying, Lana noticed that the number of the tree uniquely determines the amount of cherries the tree gives. For one tree, consider consecutive groups of digits in the tree's number. For each group of digits, multiply the digit by the square of the length of the group. Adding these numbers for all groups gives the total number of cherries the tree gives. For example, in tree number 77744007, the groups are 777, 44, 00 and 7. The amount of cherries will be 7·32 + 4·22 + 0·22 + 7·12 = 86 units. The time has come to pick the cherry trees and the villagers have agreed to pick all trees numbered A through B (inclusive). Write a program that will calculate the total amount of cherries picked.

입력

Input consists of two integers A and B (1 ≤ A ≤ B ≤ 1015), the first and last trees to be picked.

출력

Output a single integer, how many units of cherries will be picked.

예제 입력 1

1 9

예제 출력 1

45

예제 입력 2

100 111

예제 출력 2

68

예제 입력 3

7774407 7774407

예제 출력 3

86
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Platinum III1명 투표· 약 1개월 전
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.