atcoder#ARC158C. [ARC158C] All Pair Digit Sums
[ARC158C] All Pair Digit Sums
Score : points
Problem Statement
For a positive integer , let denote the sum of its digits. For instance, , , and .
You are given a sequence of positive integers . Find .
Constraints
Input
The input is given from Standard Input in the following format:
Output
Print .
2
53 28
36
We have $\sum_{i=1}^N\sum_{j=1}^N f(A_i + A_j) = f(A_1+A_1)+f(A_1+A_2)+f(A_2+A_1)+f(A_2+A_2)=7+9+9+11=36$.
1
999999999999999
135
We have $\sum_{i=1}^N\sum_{j=1}^N f(A_i + A_j) = f(A_1+A_1) = 135$.
5
123 456 789 101 112
321