#include <stdio.h>
#define ull unsigned long long
const ull M = 1000000007;
ull pow1(ull n, ull b) {
if (b == 0) {
return 1;
}
ull temp = pow1(n % M, b / 2) % M;
if (b % 2 == 1) {
return temp*temp%M*(n%M) % M;
}
return temp*temp%M;
}
ull an(ull n) {
return ((((((n%M) * ((n + 1) % M)) % M) * (2 * (n % M) % M + 1) % M) % M) + ((n%M) * ((n + 1) % M)) % M * 3 % M) % M;
}
ull total(ull h, ull w) {
return pow1(h, M - 2) * pow1(h + 1, M - 2) % M * pow1(w, M - 2) % M * pow1(w + 1, M - 2) % M;
}
int main(void) {
ull w, h;
scanf("%llu %llu", &w, &h);
w %= M;
h %= M;
ull a1 = an(w) % M;
ull a2 = an(h) % M;
ull tot = (total(w, h)% M * pow1(12 * 12, M - 2) % M) % M;
printf("%llu", a2 * a1 % M * 9 % M * 2 % M * 2 % M * tot % M);
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1084 KB |
Output is correct |
2 |
Correct |
0 ms |
1084 KB |
Output is correct |
3 |
Correct |
0 ms |
1084 KB |
Output is correct |
4 |
Correct |
0 ms |
1084 KB |
Output is correct |
5 |
Correct |
0 ms |
1084 KB |
Output is correct |
6 |
Correct |
0 ms |
1084 KB |
Output is correct |
7 |
Correct |
0 ms |
1084 KB |
Output is correct |
8 |
Correct |
0 ms |
1084 KB |
Output is correct |
9 |
Correct |
0 ms |
1084 KB |
Output is correct |
10 |
Correct |
0 ms |
1084 KB |
Output is correct |
11 |
Correct |
0 ms |
1084 KB |
Output is correct |
12 |
Correct |
0 ms |
1084 KB |
Output is correct |
13 |
Correct |
0 ms |
1084 KB |
Output is correct |
14 |
Correct |
0 ms |
1084 KB |
Output is correct |
15 |
Correct |
0 ms |
1084 KB |
Output is correct |
16 |
Correct |
0 ms |
1084 KB |
Output is correct |
17 |
Correct |
0 ms |
1084 KB |
Output is correct |
18 |
Correct |
0 ms |
1084 KB |
Output is correct |
19 |
Correct |
0 ms |
1084 KB |
Output is correct |
20 |
Correct |
0 ms |
1084 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1084 KB |
Output is correct |
2 |
Correct |
0 ms |
1084 KB |
Output is correct |
3 |
Correct |
0 ms |
1084 KB |
Output is correct |
4 |
Correct |
0 ms |
1084 KB |
Output is correct |
5 |
Correct |
0 ms |
1084 KB |
Output is correct |
6 |
Correct |
0 ms |
1084 KB |
Output is correct |
7 |
Correct |
0 ms |
1084 KB |
Output is correct |
8 |
Correct |
0 ms |
1084 KB |
Output is correct |
9 |
Correct |
0 ms |
1084 KB |
Output is correct |
10 |
Correct |
0 ms |
1084 KB |
Output is correct |
11 |
Correct |
0 ms |
1084 KB |
Output is correct |
12 |
Correct |
0 ms |
1084 KB |
Output is correct |
13 |
Correct |
0 ms |
1084 KB |
Output is correct |
14 |
Correct |
0 ms |
1084 KB |
Output is correct |
15 |
Correct |
0 ms |
1084 KB |
Output is correct |
16 |
Correct |
0 ms |
1084 KB |
Output is correct |
17 |
Correct |
0 ms |
1084 KB |
Output is correct |
18 |
Correct |
0 ms |
1084 KB |
Output is correct |
19 |
Correct |
0 ms |
1084 KB |
Output is correct |
20 |
Correct |
0 ms |
1084 KB |
Output is correct |
21 |
Incorrect |
0 ms |
1084 KB |
Output isn't correct |
22 |
Halted |
0 ms |
0 KB |
- |