# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
745934 | vjudge1 | Fancy Fence (CEOI20_fancyfence) | C11 | 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.
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int mod=1000000007;
int (int wossz, int hossz){
return (((((hossz*(hossz+1)/2)%mod) * wossz)%mod)*(wossz+1)/2)%mod;
}
int32_t main() {
// all hi are equal --> téglalap
int s;
cin>>s;
int h[s];
int w[s];
int wossz = 0;
for (int i=0; i<s; i++) cin >> h[i];
int hossz = h[0];
for(int i=0; i<s; i++){
cin>>w[i];
wossz += w[i];
}
cout << (((((hossz*(hossz+1)/2)%mod) * wossz)%mod)*(wossz+1)/2)%mod<<"\n";
// ---------------
/*int ans = (wossz, h[0]);
wossz -= w[0];
for (int i=1; i<s; i++){
ans += (wossz, h[i]);
ans -= (wossz, h[i-1]);
wossz -= w[i];
}
cout << ans;*/
return 0;
}