#include using namespace std; //#include //using boost::multiprecision::cpp_int; #define int long long #define cint cpp_int #define endl "\n" #define REP(i,a,n) for(int i=a;in;--i) #define RUP(a,b) (((a)+(b)-1)/(b)) #define ALL(v) (v).begin(),(v).end() #define pb push_back #define mp make_pair #define mt make_tuple #define MOD 1000000007 #define INF LLONG_MAX/2 #define PI acos(-1.0) #define SUM(v) accumulate((v).begin(),(v).end(), 0ll) #define range(i,left,right) (left<=i && i Pii; typedef tuple Tiii; typedef vector Vi; typedef vector VVi; typedef vector VPii; typedef vector Vs; typedef priority_queue PQi; template inline bool chmax(T& a,T b){if(a inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;} void vout(Vi &v){for(int i=0;i<(v).size();i++) cout<='0'&&c<='9'){return c-'0';}return 0;} int leng(int n){string s=to_string(n); return s.size();} //intの桁数 int digitsum(int n){int ret=0; while(n>0){ret+=n%10;n/=10;}return ret;} //桁和 int lesscount(int x,Vi &a){return lower_bound(a.begin(),a.end(),x)-a.begin();} //vector aにおけるx未満の数の個数 int orlesscount(int x,Vi &a){return upper_bound(a.begin(),a.end(),x)-a.begin();} //vector aにおけるx以下の数の個数 int morecount(int x,Vi &a){return a.size()-orlesscount(x,a);} //vector aにおけるxより大きい数の個数 int ormorecount(int x,Vi &a){return a.size()-lesscount(x,a);} //vector aにおけるx以上の数の個数 int count(int x,Vi &a) {return upper_bound(ALL(a),x)-lower_bound(ALL(a),x);} //vector aにおけるxの個数 Vi accum(Vi &v){Vi ret((v).size()+1);REP(i,0,(v).size()) ret[i+1]=ret[i]+v[i];return ret;} bool comp(Pii a,Pii b){ if(a.second != b.second) return a.second data; vector sizes; UnionFind(int n) : data(n) ,sizes(n, 1){ for(int i = 0; i < n; i++) data[i] = i; } int root(int x) { if (data[x] == x) return x; return data[x] = root(data[x]); } void unite(int x, int y) { x = root(x); y = root(y); if (x == y) return; if (y < x) swap(x, y); data[y] = x; sizes[x] += sizes[y]; } bool same(int x, int y) { int rx = root(x); int ry = root(y); return rx == ry; } int treesize(int x) { return sizes[root(x)]; } int size(){ set st; REP(i,0,data.size()) st.insert(root(i)); return st.size(); } }; signed main(){cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);cout<>n; Vi a(n); REP(i,0,n) cin>>a[i]; int sum_a=SUM(a); Vi ans(n); REP(i,0,n){ ans[i]=sum_a-(n-1)*a[i]; } vout(ans); return 0; }