提交时间:2024-01-22 10:44:34
运行 ID: 121943
#include<bits/stdc++.h> using namespace std; int l,n,temp,mn,mx; int main() { cin>>n>>l; for(int i=1;i<=n;i++) { cin>>temp; mn=max(mn,min(l-temp+1,temp)); mx=max(mx,max(l-temp+1,temp)); } cout<<mn<<" "<<mx<<endl; return 0; }