#include #include #define sqr(x) ((x)*(x)) using namespace std; const int OO = 1<<28; const int maxn = 256; int spos[maxn][3], epos[maxn][3], create[maxn], shift[maxn], dist[maxn][maxn], d[maxn], pred[maxn], n2; bool relax() { bool change = false; for (int i=0 ; i diw) { d[j] = diw; pred[j] = i; change = true; } } return change; } void negcycle() { for (int i=0 ; i> c; while (c--) { int x0, y0, z0, x1, y1, z1, n; cin >> x0 >> y0 >> z0 >> x1 >> y1 >> z1 >> n; n2 = n+2; spos[n][0] = epos[n][0] = x0; spos[n][1] = epos[n][1] = y0; spos[n][2] = epos[n][2] = z0; spos[n+1][0] = epos[n+1][0] = x1; spos[n+1][1] = epos[n+1][1] = y1; spos[n+1][2] = epos[n+1][2] = z1; create[n] = create[n+1] = -OO; shift[n] = shift[n+1] = 0; for (int i=0 ; i> spos[i][0] >> spos[i][1] >> spos[i][2] >> epos[i][0] >> epos[i][1] >> epos[i][2] >> create[i] >> shift[i]; for (int i=0 ; i