#include using namespace std; typedef long long ll; int main() { int n; cin>>n; int a[n]; for (int i=0;i>a[i]; sort(a,a+n); int ans=0; for (int x:a) ans+=abs(x-a[n/2]); cout<