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 h, w;
int wsum = 0;
int n; cin >> n;
for(int i = 0; i < n; i++){
cin >> h >> w;
wsum += w;
w = w%1000000007;
}
wsum *= (wsum+1);
wsum %= 1000000007;
wsum *= h;
wsum %= 1000000007;
wsum *= (h+1);
wsum %= 1000000007;
while(wsum % 4 != 0){
wsum += 1000000007;
}
wsum /= 4;
cout << wsum;
}
# | 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... |