luogu_1007 独木桥

//对面穿过等于换一个人继续走,整体状态没变

 

#include<bits/stdc++.h>

using namespace std;

int l,n,maxn,minn;

int main(){

scanf("%d%d",&l,&n);

l++;

while(n--){

int x;

scanf("%d",&x);

maxn=max(maxn,max(x-0,l-x));

minn=max(minn,min(x-0,l-x));

}

cout<<minn<<" "<<maxn<<endl;

return0;

}

posted @ 2017-06-24 21:38  wqtnb_tql_qwq_%%%  阅读(195)  评论(0编辑  收藏  举报