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]))

}

Python: n, m = map(int, input().split())
li = list(map(int, input().split()))
print(max(li[0]-1, n-li[-1], *[(li[i]-li[i-1])//2 for i in range(1,m)]))

Python: n, m = map(int, input().split())
a =list(map(int, input().split()))
t = max(a[0] - 1, n - a[-1])
for i in range(1, m):t = max(t, -((a[i - 1] - a[i]) // 2))
print(t)

Python: # AOJ 1574: Gossip
# Python3 2018.7.13 bal4u

n, m = map(int, input().split())
a = list(map(int, input().split()))
pre = a[0]; d = 0
for x in a[1:]:
	d = max(d, x-pre)
	pre = x
print(max(n-pre, max(d>>1, a[0]-1)))

Python: # -*- coding: utf-8 -*-

n, m = map(int, input().split())
a = list(map(int, input().split()))

ma = a[0] - 1
for i in range(m-1):
    ma = max(ma, (a[i + 1] - a[i]) // 2)
ma = max(ma, n - a[-1])

print(ma)

Python: n, m = map(int, input().split())
lst = [100000 for _ in range(n)]
a_lst = list(map(int, input().split()))
for a in a_lst:
    lst[a - 1] = 0
for i in range(n - 1):
    lst[i + 1] = min(lst[i] + 1, lst[i + 1])
for i in range(n - 1, 0, -1):
    lst[i - 1] = min(lst[i - 1], lst[i] + 1)
print(max(lst))

Python: n,m = map(int,input().split())
a = list(map(int,input().split()))
c = [a[0]-1, n-a[m-1]]
for i in range(m-1):
    c.append((a[i+1]-a[i])//2)
print(max(c))

Python: n, m = map(int, input().split())
a =list(map(int, input().split()))
t = max(a[0] - 1, n - a[-1])
for i in range(1, m):t = max(t, (a[i - 1] - a[i]) // 2)
print(t)

Python: #!/usr/bin/env python3
# -*- coding: utf-8 -*-


def solve(n, received):
    not_relayed = received.copy()
    for t in range(n + 1):
        if len(received) >= n:
            return t
        new_not_relayed = set()
        for person in not_relayed:
            if person >= 1:
                if (person - 1) not in received:
                    received.add(person - 1)
                    new_not_relayed.add(person - 1)
            if person <= n - 2:
                if (person + 1) not in received:
                    received.add(person + 1)
                    new_not_relayed.add(person + 1)
        not_relayed = new_not_relayed


def main():
    n, m = map(int, input().split())
    received_people = set(map(lambda x: int(x) - 1, input().split()))
    print(solve(n, received_people.copy()))


if __name__ == '__main__':
    main()

Python: n,m=map(int,input().split(" "))
a=list(map(int,input().split(" ")))
print(max(a[0]-1,n-a[-1],*[(a[i+1]-a[i])//2 for i in range(m-1)]))

Python: n, m = map(int, input().split())
a =[0] + list(map(int, input().split())) + [n]
t = max(a[0] - 1, n - a[-1])
for i in range(1, m):t = max(t, -((a[i - 1] - a[i]) // 2))
print(t)

Python: n, m = map(int, input().split())
a =list(map(int, input().split()))
t = max(a[0] - 1, n - a[-1])
for i in range(1, m):t = max(t, (a[i] - a[i - 1]) // 2)
print(t)

C++: /*
 * a.cc: 
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>

using namespace std;

/* constant */

const int MAX_N = 100000;

/* typedef */

/* global variables */

int as[MAX_N];

/* subroutines */

/* main */

int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) (cin >> as[i]), as[i]--;

  int ans = max(as[0], n - 1 - as[m - 1]);

  for (int i = 0; i < m - 1; i++) {
    int c = (as[i + 1] - as[i]) / 2;
    if (ans < c) ans = c;
  }

  printf("%d\n", ans);
  return 0;
}

C++: #include<iostream>
using namespace std;

int main(){
	int sum;
	while(cin >> sum){
		int number, info[100005], ans;
		cin >> number;
		for(int i = 0; i < number; i++){
			cin >> info[i];
		}
		if(sum == number){
			cout << '0'<< endl;
		}else{
			for(int i = 0; i < number + 1; i++){
				if(!i){
					ans = info[i] - 1;
				}else if(i == number){
					ans = max(ans, sum - info[i - 1]);
				}else{
					int a = (info[i] - info[i - 1] - 1) / 2;
					if(!a) a++;
					ans = max(ans, a);
				}	
			}		
			cout << ans << endl;
		}
	}
}

C++: #include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll inf =1LL << 62;
const ll mod=1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b,const ll &mod) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b,const ll &mod) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b,const ll &mod) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b,const ll &mod) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<int> dice(1,6);
uniform_real_distribution<double> score(0.0,10.0);
 
int main(void){
    int n, m; cin >> n >> m;
    vi a(m);
    for(auto & e : a) cin >> e;

    int res = max(a[0] - 1, n - a[m - 1]);
    rep(i, m - 1){
        chmax(res, (a[i + 1] - a[i]) / 2);
    }

    cout << res << endl;

    return 0;
}