#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef LOCAL #include "debug.h" #else #define debug(x...) #endif //#define int ll //#pragma GCC optimize("Ofast") using namespace std; typedef long long ll; typedef long double ld; typedef pair pii; typedef pair pll; #define sz(x) int((x).size()) #ifndef LOCAL mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); #else mt19937 rng(228); #endif const int N = 1e3 + 7; const int inf = INT_MAX / 2; const ll INF = LLONG_MAX / 3; const int MOD = 998244353; const ld eps = 1e-6; const string cars[] = {"🚗", "🚕", "🚙"}; struct Hasher { size_t operator()(const pii& x) const { return hash()(((long long)x.first)^(((long long)x.second)<<32)); } }; unordered_map < pii, bool, Hasher > used; const vector < pii > mv = { { 0, -1 }, { 0, 1 }, { 1, 0 }, { -1, 0 } }; void bfs(int xs, int ys, int t) { used[{ xs, ys }] = true; queue < tuple < int, int, int > > q; q.push({ xs, ys, t }); while (!q.empty()) { auto [x, y, t] = q.front(); q.pop(); if (t > 0) { for (auto [mx, my] : mv) { if (!used[{ x + mx, y + my }]) { used[{ x + mx, y + my }] = true; q.push({ x + mx, y + my, t - 1 }); } } } } } signed main() { #ifdef LOCAL freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif cout << fixed << setprecision(9); ios::sync_with_stdio(false), cin.tie(0), cout.tie(0); int k, c, t; cin >> k >> c >> t; if (k == 1 && c == 0) { cout << 1LL * 2 * t * (t + 1) + 1 << endl; } else { vector < pii > a(k); for (int i = 0; i < k; i++) { cin >> a[i].first >> a[i].second; } for (int i = 0; i < c; i++) { int x, y; cin >> x >> y; used[{ x, y }] = true; } for (auto[x, y] : a) { bfs(x, y, t); } int ans = 0; for (auto[x, y] : used) { ans += y; } cout << ans - c << endl; } return 0; }