题目描述
Problem Description
A teacher sent an email to the students with the following task:
Write a program that takes $n$ numbers and outputs $X$.
$$X = num_1^{p_1} + num_2^{p_2} + \cdots + num_n^{p_n}$$
$num_1$, $num_2$, $\cdots$, $num_n$ are integers, and $p_1$, $p_2$, $\cdots$, $p_n$ are single-digit numbers.
However, due to some mysterious errors, $X$ has been transformed into:
$$X = q_1 + q_2 + \cdots + q_n$$
Note: $q_i = num_i \times 10 + p_i$.
For example, the original $X$ was $21^2 + 125^3$, but now it has become $212 + 1253$. Help the teacher write a program to output the original value of $X$.
Input Format
The first line contains a positive integer $n$.
The next $n$ lines each contain an integer $q_i$.
Output Format
Output a single integer, the value of $X$.
Sample Input and Output
Sample Input #1
2
212
1253
Sample Output #1
1953566
Sample Input #2
5
23
17
43
52
22
Sample Output #2
102
Sample Input #3
3
213
102
45
Sample Output #3
10385
Notes
Data Size and Constraints
For $100\%$ of the data, $1 \le n \le 10$, $10 \le p_i \le 9.999 \times 10^3$, and $1 \leq X \leq 10^9$.
Notes
Translated from COCI 2015-2016 #3 A POT, full score is 50.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分