#include // int tmp, var = 0; を先に宣言する #define rd_int(var, tmp) \ for (;;) { \ tmp = getc_unlocked(stdin); \ if (tmp < '0' || tmp > '9') break; \ var = var * 10 + tmp - '0'; \ } // char buf[9]; int ptr = 0, sign = 0; を先に宣言する #define wt_int_s(var, buf, ptr, sign) \ if (var < 0) { \ sign = 1; \ var = -var; \ } \ while (var) { \ buf[ptr++] = var % 10; \ var /= 10; \ } \ if (!ptr) buf[ptr++] = 0; \ if (sign) putc_unlocked('-', stdout); \ while (ptr--) putc_unlocked(buf[ptr] + '0', stdout); #define wt_int_s_(var, buf, ptr, sign) \ ptr = sign = 0; \ wt_int_s(var, buf, ptr, sign); int main() { int n, s = 0, ptr, sign, tmp, x[100000]; char buf[10]; rd_int(n, tmp); for (int i = 0; i < n; ++i) { x[i] = 0; rd_int(x[i], tmp); s += x[i]; } for (int i = 0; i < n; ++i) { int a = 50 - (s - x[i] * n) / (2 * n); wt_int_s_(a, buf, ptr, sign); putc_unlocked('\n', stdout); } return 0; }