Go: package main

import (
    "bufio"
    "fmt"
    "strconv"
    "os"
    "strings"
    "math"
)

/*
var sc = bufio.NewScanner(os.Stdin) exceed MaxScanTokenSize
func read() string {
    sc.Scan()
    return sc.Text()
}
*/

var rdr = bufio.NewReaderSize(os.Stdin, 1000000)

func readLine() string {
    buf := make([]byte, 0, 1000000)
    for {
        l, p, e := rdr.ReadLine()
        if e != nil {
            panic(e)
        }
        buf = append(buf, l...)
        if !p {
            break
        }
    }
    return string(buf)
}

func toInt(str string) int {
    n, _ := strconv.Atoi(str)
    return n
}

func min(a int, b int) int {
    return int(math.Min(float64(a), float64(b)))
}

func max(a int, b int) int {
    return int(math.Max(float64(a), float64(b)))
}

func main() {
    nm := strings.Split(readLine(), " ")
    n := toInt(nm[0])
    var infoDist [100000]int
    for i := 0; i < n; i++ {
        infoDist[i] = 100000
    }
    haveInfo := strings.Split(readLine(), " ")
    for _, value := range haveInfo {
        infoDist[toInt(value) - 1] = 0
    }

    for i := 0;i < n - 1; i++ {
        infoDist[i + 1] = min(infoDist[i] + 1, infoDist[i + 1])
    }

    for i := n - 1;i > 0; i-- {
        infoDist[i - 1] = min(infoDist[i] + 1, infoDist[i - 1])
    }

    ans := 0
    for i := 0;i < n;i++ {
        ans = max(ans, infoDist[i])
    }

    fmt.Println(max(ans, infoDist[0]))

}

C++: #include <cstdio>
#include <algorithm>
using namespace std;

int main() {

    int n, m, t, prev = 1, curr, ans = 0;
    scanf("%d %d", &n, &m);

    scanf("%d", &curr);
    if (curr > 1) {
        ans = curr - 1;
        prev = curr;
    }
    for (int i = 1; i < m; i++) {
        scanf("%d", &curr);
        t = (curr - prev) / 2;
        ans = max(ans, t);
        prev = curr;
    }
    if (prev < n) {
        t = n - prev;
        ans = max(ans, t);
    }
    printf("%d\n", ans);
    return 0;
}

C++: #include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <iomanip>
#include <cassert>
//#include <utility>
//#include <memory>
//#include <functional>
//#include <deque>
//#include <cctype>
//#include <ctime>
//#include <numeric>
//#include <list>
//#include <iomanip>

//#if __cplusplus >= 201103L
//#include <array>
//#include <tuple>
//#include <initializer_list>
//#include <forward_list>
//
//#define cauto const auto&
//#else

//#endif

using namespace std;


typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()
#define DEBUG
#ifdef DEBUG
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#else
#define dump(x) 
#define debug(x) 
#endif

#define MOD 1000000007LL
#define EPS 1e-8
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)

void mainmain(){
	int ans=0;
	int n,m;
	cin>>n>>m;
	vint v(m);
	rep(i,m){
		cin>>v[i];
	}
	sort(ALL(v));
	rep(i,v.size()-1){
		maxs(ans,v[i+1]-v[i]);
	}
	ans=(ans+1)/2;
	maxs(ans,v[0]-1);
	maxs(ans,n-v.back());
	cout<<ans<<endl;
}


signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(20);
    mainmain();
}

C++: /*
N???2??????
t???+-2pi/n
a????????§in space???FFT?????????
*/
typedef double D;
typedef complex<D> P;
D pi=acos(-1);
void FFT(vector<P>& a,int N,double t){
	for(int m=N;m>=2;m/=2){
		int mh=m/2;
		rep(i,mh){
			P w=polar(1.0,t*i);
			for(int j=i;j<N;j+=m){
				int k=j+mh;
				P x=a[j]-a[k];
				a[j]+=a[k];
				a[k]=w*x;
			}
		}
		t*=2;
	}
	int i=0;
	rep1(j,N-2){
		for(int k=N/2;k>(i^=k);k/=2);
		if(j<i) swap(a[i],a[j]);
	}
}
vector<P> conv(vector<P> a,vector<P> b){
	int n=a.size()+b.size();
	int N=1;
	while(N<n) N*=2;
	a.resize(N);
	b.resize(N);
	FFT(a,N,2*pi/N);
	FFT(b,N,2*pi/N);
	rep(i,N) a[i]*=b[i];
	FFT(a,N,-2*pi/N);
	rep(i,N) a[i]/=N;
	return a;
}

C++: #include <bits/stdc++.h>
using namespace std;

// #define int long long
#define ll long long
#define pb push_back
#define vi vector<int>
#define vii vector<vector<int> >

template <class X> void print(X Target){ cout << Target << '\n'; }

bool check[100001];
bool tmp[100001];

signed main()
{
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;

  for (int i = 0; i < m; i++){
    int a;
    cin >> a;
    check[a] = true;
  }
  /*
  int cnt = 0;
  while (true){
    memcpy(tmp, check, sizeof(tmp));
    for (int i = 1; i <= n; i++){
      if (check[i]){
        if (0 < i - 1 && !tmp[i - 1]){
          tmp[i - 1] = true;
        }
        if (i + 1 <= n && !tmp[i + 1]){
          tmp[i + 1] = true;
        }
      }
    }
    cnt++;
    bool finish = true;
    for (int i = 1; i <= n; i++){
      if (!tmp[i]){
        finish = false; 
        break;
      }
    }
    if (finish) break;
    memcpy(check, tmp, sizeof(check));
  }*/
  if (m == 1){
    print(n - m);
  }
  else {
    print(n / m);
  }

  return (0);
}

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define FOR(i,a,b) for(int i=a;i<=b;++i)
#define LL long long
#define Fi first
#define Se second
using namespace std;
static const LL INF = 1LL<<61LL;
typedef pair<int,int> PII;

int N,M;
int A[100010];
int temp=1;
int ans;

int main(){
    cin>>N>>M;
    rep(i,M){
        int a;
        cin>>a;
        A[a]=1;
    }
    FOR(i,1,N){
        //cout<<temp<<endl;
        if(A[i]==1){
            if(temp==1&&A[1]!=1){
                int t=(i-temp);
                temp=i;
                ans=max(ans,t);
                continue;
            }
            int t=(i-temp-1)/2;
            if(i-temp-1<=0)t=0;
            else if((i-temp-1)%2!=0)t++;
            temp=i;
            ans=max(ans,t);
        }
        else if(i==N){
            ans=max(ans,N-temp);
        }
    }
    cout<<ans<<endl;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
	int n,m;cin>>n>>m;
	int ans=0;
	int b;
	for(int i=0;i<m;i++){
		int a;cin>>a;
		if(i==0)ans=max(ans,a-1);
		else ans=max(ans,(a-b)/2);
		b=a;
	}
	ans=max(ans,n-b);
	cout<<ans<<endl;
	return 0;
}

C++: #include <fstream>
#include <iostream>
#include <vector>
#include <iomanip>
#include <algorithm>

using namespace std;
#define ALL(c) (c).begin(), (c).end()
#define REP(i,n) for(ll i=0; i < (n); ++i)
using ll = long long;
using vl = vector<ll>;
int main(){
#ifdef _WIN32
	ifstream cin("sample.in");
	ofstream cout("sample.out");
#endif
	cout << fixed << setprecision(8);
	ll n, m; cin >> n >> m;
	vl a(m); REP(i, m) cin >> a[i];
	REP(i, m) a[i]--;

	sort(ALL(a));
	ll mi = 0;
	REP(i, n){
		auto it = lower_bound(ALL(a), i);
		ll mii = 100000;
		if(it != a.end()) mii = min<ll>(mii, abs(*it - i));
		if (it != a.begin()) mii = min<ll>(mii, abs(*--it - i));
		mi = max(mi, mii);
	}

	cout << mi << endl;
}