QOJ.ac

QOJ

実行時間制限: 1.0 s メモリ制限: 1024 MB 満点: 100 ハック可能 ✓

#9753. Modified Subtraction

統計

When Xiao L performs subtraction, he subtracts the corresponding digits directly without borrowing, which results in the digits of his answer potentially being negative, much to his teacher's distress. Please help him write a program to convert his result into the correct answer!

Formally, given a sequence $a$ of length $n$, you need to calculate $\sum_{i=1}^{n} a_i \times 10^{n-i}$.

Input

The first line contains an integer $n$ ($1 \le n \le 2 \cdot 10^5$), representing the length of the sequence obtained by Xiao L.

The second line contains $n$ integers $a_1, a_2, \dots, a_n$ ($-9 \le a_i \le 9$), with the guarantee that $a_1 \neq 0$.

Output

The first line contains an integer representing the final calculated result. The digits of the result do not need to be separated by spaces.

Examples

Input 1

3
-1 2 -3

Output 1

-83

Note

For the first example, $(-1) \times 100 + 2 \times 10 + (-3) \times 1 = -83$.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.