Sum of Maximum
题号:NC17138
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld

题目描述

Given a1, a2, ..., an, find 
modulo (109+7).

输入描述:

The input consists of several test cases and is terminated by end-of-file.
The first line of each test case contains an integer n.
The second line contains n integers a1, a2, ..., an.

输出描述:

For each test case, print an integer which denotes the result.
示例1

输入

复制
2
1 2
5
2 3 3 3 3
​

输出

复制
3
453

备注:

* 1 ≤ n ≤ 1000
* 1 ≤ ai ≤ 109
* The number of test cases does not exceed 10.