#include using namespace std; using ll = long long; ll x[1005], y[1005], r[1005]; vector edges[1005]; int c[1005]; pair dfs(int v, int z) { bool ok = true; int res = z ? 1 : -1; for (int u : edges[v]) { if (c[u] == -1) { c[u] = z ^ 1; auto [a, b] = dfs(u, z ^ 1); ok = ok && a; res += b; } else if (z == c[u]) ok = false; } return {ok, res}; } int main() { int n; scanf("%d", &n); for (int i=0; i