silu: meiyou

zhangjinghao 2023-11-25 16:10:42 2023-11-25 16:11:06 2 返回题目

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,l,p,ma=0,mi=0;
    cin>>l>>n;
    for(int i=1;i<=n;i++){
        cin>>p;
        ma=max(ma,max(l-p+1,p));
        mi=max(mi,min(l-p+1,p));
    }
    cout<<mi<<" "<<ma;
    return 0;
}
{{ vote && vote.total.up }}