#include <bits/stdc++.h>
using i64 = long long;
constexpr i64 mod = 1000000007;
constexpr i64 M = 60;
i64 add(i64 a, i64 b) {
return (a + b) % mod;
}
i64 sub(i64 a, i64 b) {
return (a + mod - b) % mod;
}
i64 mul(i64 a, i64 b) {
return (a * b) % mod;
}
void eadd(i64 &a, i64 b) {
a = add(a, b);
}
void esub(i64 &a, i64 b) {
a = sub(a, b);
}
void emul(i64 &a, i64 b) {
a = mul(a, b);
}
i64 calcPaint(i64 x, i64 y) {
return mul((1 + x) * x / 2, (1 + y) * y / 2);
}
int main() {
int N;
std::cin >> N;
std::vector<i64> H(N), W(N);
for (auto &e : H) {
std::cin >> e;
}
for (auto &e : W) {
std::cin >> e;
}
// subtask 4
i64 X = H[0], Y = std::accumulate(W.begin(), W.end(), 0ll) % mod;
std::cout << calcPaint(X, Y) << std::endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |