#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main(){
int n;
cin >> n;
vector<long long> h(n);
vector<long long> w(n);
long long m=0;
for(int i=0;i<n;i++) cin >> h[i];
for(int i=0;i<n;i++){
cin >> w[i];
m += w[i];
}
h[0] = h[0]%mod;
m = m%mod;
long long p = (h[0]*(h[0]+1)/2)%mod;
long long q = (m*(m+1)/2)%mod;
cout << (p*q)%mod << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
6 ms |
784 KB |
Output is correct |
3 |
Correct |
27 ms |
1980 KB |
Output is correct |
4 |
Correct |
55 ms |
3924 KB |
Output is correct |
5 |
Correct |
57 ms |
3920 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |