#include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
#define int long long
int mod=1e9+7;
int32_t main()
{
int n;
cin>>n;
vector<pair<int,int>> fences(n);
int h=0;
for(int i=0;i<n;i++)
{
cin>>fences[i].first;
h=fences[i].first;
}
int sum=0;
for(int i=0;i<n;i++)
{
cin>>fences[i].second;
sum=(sum+fences[i].second)%mod;
}
int row, col;
row=(((h+1)*h)/2)%mod;
col=(((sum+1)*sum)/2)%mod;
cout<<(row*col)%mod;
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... |