A Piece of Cake

题意翻译

输入:第一个整数是a[0]。之后a[0]个整数a[1],a[2],......,a[a[0]], 输出:一个整数=a[1] + 2 x a[2] + 3 x a[3] + ...... + a[0] x a[a[0]], a[0]<=100,a[i]<=1000

题目描述

How to make a cake you'll never eat. Ingredients. - 2 carrots - 0 calories - 100 g chocolate spread - 1 pack of flour - 1 egg Method. 1. Put calories into the mixing bowl. 2. Take carrots from refrigerator. 3. Chop carrots. 4. Take chocolate spread from refrigerator. 5. Put chocolate spread into the mixing bowl. 6. Combine pack of flour into the mixing bowl. 7. Fold chocolate spread into the mixing bowl. 8. Add chocolate spread into the mixing bowl. 9. Put pack of flour into the mixing bowl. 10. Add egg into the mixing bowl. 11. Fold pack of flour into the mixing bowl. 12. Chop carrots until choped. 13. Pour contents of the mixing bowl into the baking dish. Serves 1.

输入输出格式

输入格式


The only line of input contains a sequence of integers $ a_{0},a_{1},... $ ( $ 1<=a_{0}<=100 $ , $ 0<=a_{i}<=1000 $ for $ i>=1 $ ).

输出格式


Output a single integer.

输入输出样例

输入样例 #1

4 1 2 3 4

输出样例 #1

30