АВТ
Language: Russian
English

Remote Training on Programming

Problems Online status Contests
News FAQ E-learning
For authors:
Register  ||  Login
 
Hello, Guest! Please login or register.

840. Произведение всех пар

Time Limit: 1 seconds
Memory Limit:65536KB
Points:100
View Problem Statistics Submit Problem added Alex Tolstov

You have a sequence of N non-negative integers. N <= 100 000. You need to find sum of multiplies of all pairs numbers and output this value by modulo P = 30 000.

Input:
The first line of input contains integer N, 1 <= N <= 100 000.
The second line contains N integers, all of them satisfy following condition: 0 <= x <= 10000.

Output:
Multiply of all pairs by modulo P.

Example:
InputOutput
3
1 2 3
11
Hint: In example we have: 1 * 2 + 1 * 3 + 2 * 3 = 11.
Remember that James Gosling with us!


View Problem Statistics Submit Problem discussion Author/source:
Sorted Problems / Dynamic Data Structures /
244. Очередь. 840.
Educational Courses / Algorithms and Data Structures / Data Structures /
248. Постфиксная запись 840.
time generating 0.125 sec.
© Copyright VSU, AVT, Nosov D.A., Andrianov I.A.