Submission #19789

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
197892016-02-25 05:40:02xhae창문 (kriii4_C)C++14
3 / 100
0 ms1084 KiB
#include <cstdio>
const long long MOD = 1000000007;
long long inv(long long tar) {
long long ret = 1;
for(int i = 30; i >= 0; i--) {
ret = ret * ret % MOD;
if((1ll << i) & (MOD - 2)) ret = ret * tar % MOD;
}
return ret;
}
long long func(long long c, long long x) {
long long ret = (x * x % MOD * x % MOD * inv(3) % MOD * -1 + MOD) % MOD;
ret = (ret + x * x % MOD * c % MOD * inv(2) % MOD) % MOD;
ret = (ret + c * inv(2) % MOD * x % MOD + x * inv(3) % MOD) % MOD;
return ret;
}
int main(void) {
long long h, w;
scanf("%lld %lld", &h, &w);
h %= MOD;
w %= MOD;
long long xsum = func(w, w);
long long ysum = func(h, h);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...