Submission #19718

#TimeUsernameProblemLanguageResultExecution timeMemory
19718xdoju창문 (kriii4_C)C++14
3 / 100
0 ms1084 KiB
#include <cstdio> using namespace std; const long long MOD = 1000000007ll; long long modpow(long long r, long long n) { long long ret = 1; while (n > 0) { if (n % 2 > 0) { ret = (ret * r) % MOD; } r = (r * r) % MOD; n /= 2; } return ret; } long long modinv(long long n) { return modpow(n, MOD - 2); } void proc() { long long h, w; scanf("%lld %lld", &h, &w); long long t = (((w * (w + 1) * (w + 2)) % MOD) * modinv(6)) % MOD; long long u = (((h * (h + 1) * (h + 2)) % MOD) * modinv(6)) % MOD; long long v = (((t * u) % MOD) * 9) % MOD; v = (v * modinv(w * (w + 1))) % MOD; v = (v * modinv(h * (h + 1))) % MOD; v = (v * 4) % MOD; printf("%lld", v); } int main() { proc(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...