// TTarget.cc // TF solution to Target // 2007 ECNA #include using namespace std; const int MAXPTS = 66; const int MAXLINES = MAXPTS * MAXPTS; struct { int x,y,z; } Pts[MAXPTS]; int Lines[MAXLINES][MAXPTS]; int NumLines, NumPts; int Best, X[MAXLINES]; void PrintPts(){ for(int i=1;i<=NumPts;i++) cout<<"point "<>Pts[i].x>>Pts[i].y>>Pts[i].z; } void Print3Lines(){ cout<<"Lines="<=0;i--){ if(!(i==1 && PtsLeftOnLine(k)<3)){ X[k]=i; if(k==NumLines){ L = CalculateLines(); //cout<<"L="<>NumPts; while(NumPts>0){ GetPts(); //PrintPts(); Make3Lines(); //Print3Lines(); cout<<"Target set "<< Case++<<" can be cleared using only "; Cover(); cout<<" shots."<>NumPts; } return 0; }