提交时间:2024-01-21 15:15:28
运行 ID: 121096
#include<bits/stdc++.h> using namespace std; int main() { int n,l,maxn=0,minn=0; scanf("%d%d",&n,&l); for(int i=1,temp;i<=n;i++) { scanf("%d",&temp); maxn=max(maxn,max(l-temp+1,temp)); minn=max(minn,min(l-temp+1,temp)); } cout<<minn<<" "<<maxn; return 0; }