시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 17 9 9 90.000%

문제

두 자연수 l과 u가 주어졌을 때, l보다 크거나 같고, u보다 작거나 같은 모든 자연수의 자리수의 합을 구하는 프로그램을 작성하시오.

입력

첫째 줄에 l과 r이 주어진다. (0 ≤ l ≤ u ≤ 2,000,000,000)

출력

l과 r을 포함하여 그 사이에 있는 모든 수의 자리수의 합을 출력한다.

예제 입력 1

24660 308357171

예제 출력 1

11379854844

힌트

W3sicHJvYmxlbV9pZCI6Ijc3ODYiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWQ1NjkgXHVjYzNlXHVhZTMwIiwiZGVzY3JpcHRpb24iOiI8cD5cdWI0NTAgXHVjNzkwXHVjNWYwXHVjMjE4IGxcdWFjZmMgdVx1YWMwMCBcdWM4ZmNcdWM1YjRcdWM4NGNcdWM3NDQgXHViNTRjLCBsXHViY2Y0XHViMmU0IFx1ZDA2Y1x1YWM3MFx1YjA5OCBcdWFjMTlcdWFjZTAsIHVcdWJjZjRcdWIyZTQgXHVjNzkxXHVhYzcwXHViMDk4IFx1YWMxOVx1Yzc0MCBcdWJhYThcdWI0ZTAgXHVjNzkwXHVjNWYwXHVjMjE4XHVjNzU4IFx1Yzc5MFx1YjlhY1x1YzIxOFx1Yzc1OCBcdWQ1NjlcdWM3NDQgXHVhZDZjXHVkNTU4XHViMjk0IFx1ZDUwNFx1Yjg1Y1x1YWRmOFx1YjdhOFx1Yzc0NCBcdWM3OTFcdWMxMzFcdWQ1NThcdWMyZGNcdWM2MjQuPFwvcD5cclxuIiwiaW5wdXQiOiI8cD5cdWNjYWJcdWM5ZjggXHVjOTA0XHVjNWQwIGxcdWFjZmMgclx1Yzc3NCBcdWM4ZmNcdWM1YjRcdWM5YzRcdWIyZTQuICgwICZsZTsgbCAmbGU7IHUgJmxlOyAyLDAwMCwwMDAsMDAwKTxcL3A+XHJcbiIsIm91dHB1dCI6IjxwPmxcdWFjZmMgclx1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