P7226 [COCI 2015/2016 #3] POT

Description

The teacher sent an email to the students with the following task. > Write a program that, given $n$ numbers, outputs $X$. > $$X = num_1^{p_1} + num_2^{p_2} + \cdots + num_n^{p_n}$$ > $num_1$, $num_2$, $\cdots$, $num_n$ are all integers, and $p_1$, $p_2$, $\cdots$, $p_n$ are all one-digit numbers. However, due to some mysterious errors, $X$ became: $$X = q_1 + q_2 +... + q_n$$ Note: $q_i = num_i \times 10 + p_i$. For example, the original $X$ is $21^2 + 125^3$, but now it becomes $212 + 1253$. Please 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

Print one integer on a single line: the value of $X$.

Explanation/Hint

#### Constraints For $100\%$ of the testdata, $1 \le n \le 10$, $10 \le q_i \le 9.999 \times 10 ^ 3$, $1 \leq X \leq 10 ^ 9$. #### Notes Translated from [COCI 2015-2016 #3 A POT](https://hsin.hr/coci/archive/2015_2016/contest3_tasks.pdf), full score 50. Translated by ChatGPT 5