#include #include #include using namespace std; using ll = long long; int power_mod(int a,int n,int m){ ll ans=1; ll x=a%m; while (n>0){ if (n%2==1){ ans=(ans*x)%m; } x=(x*x)%m; n/=2; } return ans; } int max(vector X){ int r=X[0]; for (auto x:X) if (r X){ int r=X[0]; for (auto x:X) if (r>x) r=x; return r; } ll unfairness(int p, int e, int a, int h){ return max({p,e,a,h})-min({p,e,a,h}); } void vector_input(vector& X){ for(int i=0;i> X.at(i); } sort(X.begin(),X.end()); } int main(){ int N,K,M; cin >> N >> K >> M; vector P(N),E(N),A(N),H(N); vector_input(P); vector_input(E); vector_input(A); vector_input(H); ll X=0; int y,z; for (int i=0;i