#include #define fi first #define se second #define rep(i,s,n) for (int i = (s); i < (n); ++i) #define rrep(i,n,g) for (int i = (n)-1; i >= (g); --i) #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() #define len(x) (int)(x).size() #define dup(x,y) (((x)+(y)-1)/(y)) #define pb push_back #define eb emplace_back #define Field(T) vector> #define pq(T) priority_queue, greater> using namespace std; using ll = long long; using ull = unsigned long long; using P = pair; templatebool chmax(T&a,T b){if(abool chmin(T&a,T b){if(b> n; int a = 0, b = 0; rep(i,0,n) { int c; cin >> c; a = min(a, c), b = max(b, c); } cout << (b-a)*2 << endl; return 0; }