Time limit: 3s
Memory limit: 1024MB
Input:
Output:
likes teaching his students about divisors. He came up with the following problem:
You are given an array of length . We define .
Determine modulo
Input data
The first line will contain (). On the next line there are integers ()
Output data
Print the sum modulo
Example 1
stdin
4
1 2 3 4
stdout
50
Example 2
stdin
5
2 4 6 12 3
stdout
457