307819: CF1422C. Bargain

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Bargain

题意翻译

### 题目描述 给定整数 $n(1 \leq len(n) < 10^5$ ,其中 $len(n)$ 表示 $n$ 的位数$)$ ,现在规定每一轮Vova可以从中取出一段连续的几位数字,剩余数字即为该轮得分.结果可以拥有前导 $0$ .特别的,如果Vova取出了所有数字,那么该轮得分为 $0$ . 现在请你求出所有不同取法得分之和对 $10^9+7$ 取模后的值.特别的,如果有多种不同取法得到了同样的数字,得分要计多次. ### 输入输出格式 输入一行一个整数 $n$ ,表示要被取的数. 输出一行一个整数,表示得分之和对 $10^9+7$ 取模后的值. ### 样例解释 对于样例一: Vova可以选择去掉: $1,0,7,10,07,107$ ,得分分别是 $07,17,10,7,1,0$ ,得分之和为 $42$ .

题目描述

Sometimes it is not easy to come to an agreement in a bargain. Right now Sasha and Vova can't come to an agreement: Sasha names a price as high as possible, then Vova wants to remove as many digits from the price as possible. In more details, Sasha names some integer price $ n $ , Vova removes a non-empty substring of (consecutive) digits from the price, the remaining digits close the gap, and the resulting integer is the price. For example, is Sasha names $ 1213121 $ , Vova can remove the substring $ 1312 $ , and the result is $ 121 $ . It is allowed for result to contain leading zeros. If Vova removes all digits, the price is considered to be $ 0 $ . Sasha wants to come up with some constraints so that Vova can't just remove all digits, but he needs some arguments supporting the constraints. To start with, he wants to compute the sum of all possible resulting prices after Vova's move. Help Sasha to compute this sum. Since the answer can be very large, print it modulo $ 10^9 + 7 $ .

输入输出格式

输入格式


The first and only line contains a single integer $ n $ ( $ 1 \le n < 10^{10^5} $ ).

输出格式


In the only line print the required sum modulo $ 10^9 + 7 $ .

输入输出样例

输入样例 #1

107

输出样例 #1

42

输入样例 #2

100500100500

输出样例 #2

428101984

说明

Consider the first example. Vova can choose to remove $ 1 $ , $ 0 $ , $ 7 $ , $ 10 $ , $ 07 $ , or $ 107 $ . The results are $ 07 $ , $ 17 $ , $ 10 $ , $ 7 $ , $ 1 $ , $ 0 $ . Their sum is $ 42 $ .

Input

题意翻译

### 题目描述 给定整数 $n(1 \leq len(n) < 10^5$ ,其中 $len(n)$ 表示 $n$ 的位数$)$ ,现在规定每一轮Vova可以从中取出一段连续的几位数字,剩余数字即为该轮得分.结果可以拥有前导 $0$ .特别的,如果Vova取出了所有数字,那么该轮得分为 $0$ . 现在请你求出所有不同取法得分之和对 $10^9+7$ 取模后的值.特别的,如果有多种不同取法得到了同样的数字,得分要计多次. ### 输入输出格式 输入一行一个整数 $n$ ,表示要被取的数. 输出一行一个整数,表示得分之和对 $10^9+7$ 取模后的值. ### 样例解释 对于样例一: Vova可以选择去掉: $1,0,7,10,07,107$ ,得分分别是 $07,17,10,7,1,0$ ,得分之和为 $42$ .

加入题单

算法标签: