第 045 场 AtCoder Beginner Contest
C
Many Formulas
AtCoder
⌀ 1089
原题
← BD →
翻译中…

Problem Statement

翻译中…

You are given a string $S$ consisting of digits between 1 and 9, inclusive. You can insert the letter + into some of the positions (possibly none) between two letters in this string. Here, + must not occur consecutively after insertion.

翻译中…

All strings that can be obtained in this way can be evaluated as formulas.

翻译中…

Evaluate all possible formulas, and print the sum of the results.

翻译中…

Constraints

翻译中…
  • $1 \leq |S| \leq 10$
  • All letters in $S$ are digits between 1 and 9, inclusive.
翻译中…

Input

翻译中…

The input is given from Standard Input in the following format:

翻译中…

S

翻译中…

Output

翻译中…

Print the sum of the evaluated value over all possible formulas.

翻译中…

样例

Input #1
125
Output #1
176
There are $4$ formulas that can be obtained: `125`, `1+25`, `12+5` and `1+2+5`. When each formula is evaluated, - $125$ - $1+25=26$ - $12+5=17$ - $1+2+5=8$ Thus, the sum is $125+26+17+8=176$.
Input #2
9999999999
Output #2
12656242944
题目信息
题号
arc061_a
时间限制
2 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。