# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
628685 | a_aguilo | Fancy Fence (CEOI20_fancyfence) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
using namespace std;
int MOD = 1e9 + 7;
int main(){
int n, h, w;
cin >> n;
long long int H = 0;
for(int i = 0; i < n; ++i){
cin >> H;
}
long long int W = 0;
for(int i = 0; i < n; ++i){
cin >> w;
W += w;
W%=MOD;
}
long long chooseh = (H*(H+1)/2)%MOD;
long long choosew = (W*(W+1)/2)%MOD;
cout << (chooseh*choosew)%MOD << endl;
return 0;
}