#include <stdio.h>
int main() {
int n,i,j,z,a = 0,b,c,d,l = 0;
for (i = 0; i < n; ++i) {
if (z > 2) {
a = 0;
for (j = 0; j < (2*z); ++j) {
if (b < 1 || b > 50)
++l;
if (j < z)
a = a + b;
else
a = a - b;
}
a = 0 - a;
if (a % (z-2) == 0 && l==0)
else
}
else if(z == 2) {
scanf("%d%d%d%d", &a
, &b
, &c
, &d
); if ((c-a) == (b-d) && !((a < 1)||(b < 1)||(c < 1)||(d < 1)||(a > 50)||(b > 50)||(c > 50)||(d > 50))) {
if ((c-a) > 0)
else
}
else
}
else {
if((a-b) > 0 && !((a < 1) || (b < 1)|| (a > 50) || (b > 50)))
else
}
}
return 0;
}
ICAgICNpbmNsdWRlIDxzdGRpby5oPgogICAgIAogICAgaW50IG1haW4oKSB7CiAgICAJaW50IG4saSxqLHosYSA9IDAsYixjLGQsbCA9IDA7CiAgICAJc2NhbmYoIiVkIiwgJm4pOwogICAgCWZvciAoaSA9IDA7IGkgPCBuOyArK2kpIHsKICAgIAkJc2NhbmYoIiVkIiwgJnopOwogICAgCQlpZiAoeiA+IDIpIHsKICAgIAkJCWEgPSAwOwogICAgCQkJZm9yIChqID0gMDsgaiA8ICgyKnopOyArK2opIHsKICAgIAkJCQlzY2FuZigiJWQiLCAmYik7CiAgICAJCQkJaWYgKGIgPCAxIHx8IGIgPiA1MCkKCQkJCQkJKytsOwogICAgCQkJCWlmIChqIDwgeikKICAgIAkJCQkJYSA9IGEgKyBiOwogICAgCQkJCWVsc2UKICAgIAkJCQkJYSA9IGEgLSBiOwogICAgCQkJfQkKICAgIAkJCWEgPSAwIC0gYTsKICAgIAkJCWlmIChhICUgKHotMikgPT0gMCAmJiBsPT0wKQogICAgCQkJCXByaW50ZigiJWRcbiIsIGEvKHotMikpOwoJCQkgICAgZWxzZQoJCQkJICAgIHByaW50ZigiLTFcbiIpOwogICAgCQl9CiAgICAJCWVsc2UgaWYoeiA9PSAyKSB7CiAgICAJCQlzY2FuZigiJWQlZCVk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