atcoder#ARC107A. [ARC107A] Simple Math
[ARC107A] Simple Math
Score : points
Problem Statement
Given are three positive integers , , and . Compute the following value modulo :
Constraints
Input
Input is given from standard input in the following format:
Output
Print the value modulo .
1 2 3
18
We have: $(1 \times 1 \times 1) + (1 \times 1 \times 2) + (1 \times 1 \times 3) + (1 \times 2 \times 1) + (1 \times 2 \times 2) + (1 \times 2 \times 3) = 1 + 2 + 3 + 2 + 4 + 6 = 18$.
1000000000 987654321 123456789
951633476
Be sure to compute the value modulo .