제출 #19825

#제출 시각아이디문제언어결과실행 시간메모리
19825sys7961창문 (kriii4_C)C11
3 / 100
0 ms1084 KiB
#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;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...