#include <bits/stdc++.h>
using namespace std;
#define int long long
int n,m;
int mod=1e9+7;
int clc(int x) { return (((x*(x+1)))/(long long)2)%mod; }
signed main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
cin >> n;
int H;
int width=0;
for (int i = 0; i < n; i++) cin >> H;
for (int i = 0; i < n; i++) {
int x; cin >> x;
width+=x;
width%=mod;
}
int outp=(clc(width%mod)*clc(H%mod));
outp%=mod;
cout << outp << "\n";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 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 |
2 ms |
464 KB |
Output is correct |
3 |
Correct |
8 ms |
1372 KB |
Output is correct |
4 |
Correct |
16 ms |
2396 KB |
Output is correct |
5 |
Correct |
18 ms |
2360 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 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 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |