#include<bits/stdc++.h> usingnamespacestd; using ll = longlong;
inlineintrd(){ int x = 0; bool f = 0; char c = getchar(); for (; !isdigit(c); c = getchar()) f |= (c == '-'); for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48); return f ? -x : x; }
#include<bits/stdc++.h> usingnamespacestd; using ll = longlong;
inlineintrd(){ int x = 0; bool f = 0; char c = getchar(); for (; !isdigit(c); c = getchar()) f |= (c == '-'); for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48); return f ? -x : x; }
unordered_map<ll, bool> vis;
inline ll pos(int x, int y){return1ll * x * 1000000000 + y;}
ll ans[10];
intmain(){ int h = rd(), w = rd(); ans[0] = 1ll * (h - 2) * (w - 2); for (int n = rd(); n; --n) { int x = rd(), y = rd(); for (int a = max(1, x - 2); a <= min(x, h - 2); ++a) for (int b = max(1, y - 2); b <= min(y, w - 2); ++b) { int cnt = 0; for (int dx = 0; dx < 3; ++dx) for (int dy = 0; dy < 3; ++dy) cnt += vis[pos(a + dx, b + dy)]; --ans[cnt]; ++ans[cnt + 1]; } vis[pos(x, y)] = 1; } for (int i = 0; i < 10; ++i) printf("%lld\n", ans[i]); return0; }
#include<bits/stdc++.h> usingnamespacestd; using ll = longlong;
inlineintrd(){ int x = 0; bool f = 0; char c = getchar(); for (; !isdigit(c); c = getchar()) f |= (c == '-'); for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48); return f ? -x : x; }
#include<bits/stdc++.h> usingnamespacestd; using ll = longlong;
inlineintrd(){ int x = 0; bool f = 0; char c = getchar(); for (; !isdigit(c); c = getchar()) f |= (c == '-'); for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48); return f ? -x : x; }
#define N 1000007 #define mod 1000000007
namespace Comb { int fac[N], ifac[N];
inlineintfpow(int x, int t){ int res = 1; for (; t; t >>= 1, x = 1ll * x * x % mod) if (t & 1) res = 1ll * res * x % mod; return res; }
inlinevoidinit(){ fac[0] = ifac[0] = 1; for (int i = 1; i < N; ++i) fac[i] = 1ll * fac[i - 1] * i % mod; ifac[N - 1] = fpow(fac[N - 1], mod - 2); for (int i = N - 2; i; --i) ifac[i] = 1ll * ifac[i + 1] * (i + 1) % mod; }
inline ll C(int n, int m){ if (n < m) return0; return1ll * fac[n] * ifac[m] % mod * ifac[n - m] % mod; } } usingnamespace Comb;
ll pw2[N] = {1}, pw3[N] = {1}, f1[N], f2[N];
intmain(){ init(); ll ans = 0; int n = rd(), m = rd(), k = rd(); for (int i = 1; i < N; ++i) { pw2[i] = (pw2[i - 1] << 1) % mod; pw3[i] = pw3[i - 1] * 3 % mod; f1[i] = (2 * f1[i - 1] + C(i - 1, m)) % mod; f2[i] = (2 * f2[i - 1] + C(i - 1, k)) % mod; } for (int l = n; l <= n + m + k; ++l) { ll w = ((pw2[l - n] - f1[l - n] - f2[l - n]) % mod + mod) % mod; ans = (ans + C(l - 1, n - 1) * w % mod * pw3[n + m + k - l]) % mod; } printf("%lld\n", ans); return0; }