// input checker probH - ECNA2015 #include #include using namespace std; double dist(int a, int b, int c, int d){ return(sqrt((a-c)*(a-c) + (b-d)*(b-d))); } int main(){ int w,l; int r, x1,y1,x2,y2,x3,y3,h; cin>>w>>l; if(w>120 || l>120) { cout<<"table too big"; return 1; } cin>>r>>x1>>y1>>x2>>y2>>x3>>y3>>h; //balls overlap? if (dist(x1,y1,x2,y2)<2*r) { cout<<"1 and 2 overlap"; return 2; } if (dist(x1,y1,x3,y3)<2*r) { cout<<"1 and 3 overlap"; return 3; } if (dist(x3,y3,x2,y2)<2*r) { cout<<"3 and 2 overlap"; return 4; } //balls on table? if (x1-r<0 || x1+r>w || y1+r>l) { cout<<"ball 1 off table"; return 5; } if (x2-r<0 || x2+r>w || y2+r>l) { cout<<"ball 2 off table"; return 6; } if (x3-r<0 || x3+r>w || y3+r>l) { cout<<"ball 3 off table"; return 7; } //above h line? if(y1-r