#include #include #include using namespace std; typedef long long int ll; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; if(n==1){ cout << 0 << endl; return 0; } vector a(n); for(int i=0;i> a[i]; } sort(a.begin(),a.end()); int ans=1e9; for(int i=0;i