#include <bits/stdc++.h>   using namespace std;   const int INF = 0x3f3f3f3f;   const double PI = 3.14159265;   const double E = 2.718281828459;   const double EPS = 1e-8;   const int M = 2e5 + 5;   long long n, A;   long long a[M];   int main() {     while (~scanf( %I64d %I64d , &n, &A)) {       long long sumb = 0;       for (int i = 0; i < n; i++) {         scanf( %I64d , a + i);         sumb += a[i];       }       long long minb = n - 1;       bool first = true;       for (int i = 0; i < n; i++) {         long long cnt = 0;         long long x = A - minb;         if (a[i] > x) cnt += a[i] - x;         long long y = A - (sumb - a[i]);         if (y > 0) cnt += y - 1;         if (first) {           printf( %I64d , cnt);           first = false;         } else           printf(  %I64d , cnt);       }       printf(  n );     }   }   