#include<bits/stdc++.h> using namespace std; int main() { int l,n,x,a,b,maxx=0,minn=0; cin>>l>>n; for (int i=1;i<=n;i++) { cin>>x; a=min(x,l+1-x); b=max(x,l+1-x); minn=max(minn,a); maxx=max(maxx,b); } cout<<minn<<' '<<maxx; return 0; }
就这么少