#include using namespace std; typedef long long ll; typedef long double ld; typedef pair ii; typedef vector vi; typedef vector vvi; typedef vector vii; #define x first #define y second #define pb push_back #define eb emplace_back #define rep(i,a,b) for(auto i = (a); i < (b); ++i) #define REP(i,n) rep(i,0,n) #define all(v) begin(v), end(v) #define sz(v) ((int) (v).size()) #define rs resize vector> buren; vector groep; ll groep1, groep2; bool dfs(ll x, ll g)//Geef terug of de component bipartiet is { if(groep[x] != -1){ return (groep[x] == g); } groep[x] = g; if(g == 0){ groep1++; } else{ groep2++; } ll buur; bool bip = true; for(ll y = 0; y< buren[x].size();y++){ buur = buren[x][y]; if(!dfs(buur, 1- g)){ bip = false; } } return bip; } signed main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout << fixed << setprecision(20); ll n; cin>>n; vector px,py, straal; ll nu; for(ll a=0;a>nu; px.push_back(nu); cin>>nu; py.push_back(nu); cin>>nu; straal.push_back(nu); } //Bepaal de buren ll rtot, dx,dy; for(ll x=0;x vec; for(ll y = 0; y< n;y++){ if(x!=y){ dx = px[x] - px[y]; dy = py[x] - py[y]; rtot = straal[x] + straal[y]; if(rtot * rtot == dx * dx + dy * dy){ vec.push_back(y); } } } buren.push_back(vec); groep.push_back(-1); } //Bepaal of het kan bool kan = false; for(ll x=0;x