{
IntVar[] x = VariableFactory.enumeratedArray("x", k, 0, k - 1, ref);
IntVar[] y = VariableFactory.enumeratedArray("y", k - 1, -(k - 1), k - 1, ref);
IntVar[] t = VariableFactory.enumeratedArray("t", k - 1, 0, k - 1, ref);
for (int i = 0; i < k - 1; i++) {
ref.post(new Scalar(new IntVar[]{x[i + 1], x[i]}, new int[]{1, -1}, y[i], 1));
ref.post(IntConstraintFactory.absolute(t[i], y[i]));
}
ref.post(IntConstraintFactory.alldifferent(x, "BC"));
ref.post(IntConstraintFactory.alldifferent(t, "BC"));
ref.post(IntConstraintFactory.arithm(x[1], ">", x[0]));