This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
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];
}
long long mod = 1000000007;
long long p = (h[0]*(h[0]+1))/2;
long long q = (m*(m+1))/2;
p = p%mod;
q = q%mod;
cout << (p*q)%mod << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |