시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 18 5 4 50.000%

문제

상근이는 작은 마을에 살고 있다. 이 마을에서 가장 큰 거리에는 사과 나무가 한 줄로 있다. 상근이는 사과에 번호를 붙였다. 제일 처음 나무는 1번이고, 순서대로 번호를 붙였다.

이 거리를 매일 지나다니는 상근이는 각 나무가 가지고 있는 사과의 개수는 나무의 번호와 깊은 관계가 있다는 사실을 알게 되었다.

각 나무의 번호에 있는 연속되는 숫자의 그룹을 찾는다. 연속되는 숫자의 그룹은 같은 숫자로 되어 있는 연속하는 구간이다. 사과의 개수는 각 그룹의 길이의 제곱과 연속하는 숫자의 곱을 모두 더하면 된다.

예를 들어, 나무의 번호가 77744007이라면, 연속되는 숫자의 그룹은 777, 44, 00, 7이다. 이 나무가 가지고 있는 사과의 개수는 7·32 + 4·22 + 0·22 + 7·12 = 86가 된다.

상근이는 A번부터 B번나무에 있는 사과를 모두 수확하려고 한다. 상근이가 수확하는 사과의 개수를 구하는 프로그램을 작성하시오.

입력

첫째 줄에 A와 B가 주어진다. (1 ≤ A ≤ B ≤ 1015)

출력

A번 부터 B번 나무에 있는 사과의 개수를 출력한다. (A와 B번도 포함 한다)

예제 입력 1

1 9

예제 출력 1

45
W3sicHJvYmxlbV9pZCI6IjI5NDUiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWMwYWNcdWFjZmNcdWM3NTggXHVhYzFjXHVjMjE4IiwiZGVzY3JpcHRpb24iOiI8cD5cclxuXHRcdWMwYzFcdWFkZmNcdWM3NzRcdWIyOTQgXHVjNzkxXHVjNzQwIFx1YjljOFx1Yzc0NFx1YzVkMCBcdWMwYjRcdWFjZTAgXHVjNzg4XHViMmU0LiBcdWM3NzQgXHViOWM4XHVjNzQ0XHVjNWQwXHVjMTFjIFx1YWMwMFx1YzdhNSBcdWQwNzAgXHVhYzcwXHViOWFjXHVjNWQwXHViMjk0IFx1YzBhY1x1YWNmYyBcdWIwOThcdWJiMzR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