Skip to content

Instantly share code, notes, and snippets.

@pagodepaiva
Created January 14, 2023 15:52
Show Gist options
  • Save pagodepaiva/4c9ac891065774d19c994c50c58ab5cd to your computer and use it in GitHub Desktop.
Save pagodepaiva/4c9ac891065774d19c994c50c58ab5cd to your computer and use it in GitHub Desktop.
caravana.cpp
#include<bits/stdc++.h>
using namespace std;
int32_t main(){
ios::sync_with_stdio(false); cin.tie(0);
int n;
cin >> n;
int sum = 0;
int v[n+5];
for(int i = 1;i <= n;i++){
cin >> v[i];
sum += v[i];
} sum /= n;
for(int i = 1;i <= n;i++){
cout << a[i] - sum << "\n";
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment