long int mx = *max_element(A.begin(),A.end()); long int mn = *min_element(A.begin(), A.end());
return (int)(mx+mn);