Logo
(追記) (追記ここまで)

19840번 - Misha's Product 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB62302854.902%

문제

Misha really loves to invent new operations. Recently he has invented the new operation, that he has named Misha's product after himself.

Misha's product of the set of different integer numbers $a_1, a_2, \ldots, a_n$ is defined as follows. Consider all possible ordered pairs $(a_i, a_j)$ of different numbers from this set. For each pair write these numbers one after another without a space, and get a new number $b_{ij}$. Misha's product of the initial set is the sum of all values $b_{ij}$.

Help Misha to calculate Misha's product for the given set of integers. Misha wants to calculate it modulo 10ドル^9 + 7$.

입력

The first line contains one integer $n$ --- the number of elements in the set (2ドル \le n \le 10^5$).

The second line contains $n$ different integers $a_1, a_2, \ldots, a_n$ --- numbers from the set (1ドル \le a_i \le 10^8$).

출력

Output one number --- Misha's product of the given set of numbers, modulo 10ドル^9 + 7$.

제한

예제 입력 1

3
1 3 10

예제 출력 1

668

힌트

There are six possible pairs in sample test, the following values $b_{ij}$ are obtained: 13, 31, 101, 103, 110, 310, their sum is equal to 668.

출처

Olympiad > Russian Olympiad in Informatics > Russia Team High School Programming Contest > Russia Team High School Programming Contest 2017 K번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /