#include #include #include #include using namespace std; int X1[3]; int X2[3]; int Y1[3]; int Y2[3]; int X3[3]; int Y3[3]; void rot(int x, double ang) { X3[x] = (int)round(X1[x] * cos(ang) - Y1[x] * sin(ang)); Y3[x] = (int)round(X1[x] * sin(ang) + Y1[x] * cos(ang)); } int trr(vector pi, int dx, int dy) { double ang = -atan2(dy, dx); rot(0, ang); rot(1, ang); rot(2, ang); int xs = 0; int ys = 0; for(int i = 0; i < 3; i++) { for(int j = i + 1; j < 3; j++) { int dx2 = X2[pi[j]] - X2[pi[i]]; int dx3 = X3[j] - X3[i]; int dy2 = Y2[pi[j]] - Y2[pi[i]]; int dy3 = Y3[j] - Y3[i]; if(dx3 != 0) { if(dx2 == 0 || dx2 % dx3 != 0) return 0; int nxs = dx2 / dx3; if(xs && nxs != xs) return 0; xs = nxs; } else if(dx2) { return 0; } if(dy3 != 0) { if(dy2 == 0 || dy2 % dy3 != 0) return 0; int nys = dy2 / dy3; if(ys && nys != ys) return 0; ys = nys; } else if(dy2) { return 0; } } } if(!xs || !ys) return 4; return 1; } int main() { cin >> X1[0] >> Y1[0] >> X1[1] >> Y1[1] >> X1[2] >> Y1[2]; for(int t = 1; X1[0] || Y1[0] || X1[1] || Y1[1] || X1[2] || Y1[2]; t++) { cin >> X2[0] >> Y2[0] >> X2[1] >> Y2[1] >> X2[2] >> Y2[2]; int res = 0; vector pi; for(int i = 0; i < 3; i++) pi.push_back(i); do { for(int dx = -10; dx <= 10; dx++) { res += trr(pi, dx, 10); res += trr(pi, dx, -10); } for(int dy = -9; dy <= 9; dy++) { res += trr(pi, 10, dy); res += trr(pi, -10, dy); } } while(next_permutation(pi.begin(), pi.end())); res /= 2; cout << "Case " << t << ": "; if(res == 0) { cout << "no solution" << endl; } else if(res == 1) { cout << "equivalent solutions" << endl; } else { cout << "inconsistent solutions" << endl; } cin >> X1[0] >> Y1[0] >> X1[1] >> Y1[1] >> X1[2] >> Y1[2]; } }