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 <bits/stdc++.h>
typedef long long LL;
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

using namespace std;
int main(void)
{
  int n,m;
  cin >> n >> m;
  vector<int> se;
  se.resize(m);
  REP(i,m) cin >> se[i];
  int answer=0;
  answer=max(answer,se[0]-1);
  REP(i,m-1) answer=max(answer,(se[i+1]-se[i])/2);
  answer=max(answer,n-se[m-1]);
  cout << answer << endl;
  return 0;
}

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

int main(){ 

  int n,m,A[100000],ans;
  int i;
  
  cin >> n >> m;
  
  for(i=0;i<m;i++){
    cin >> A[i];
  }

  if(m==1){
    cout << max(n-A[0],A[0]-1) << endl;
    return -1;
  }
  else if(m==2){
    ans=max(A[0]-1,n-A[1]);
    ans=(ans,(A[1]-A[0])/2);
    cout << ans << endl;
    return -1;
  }
  else{
    for(i=0;i<m;i++){
      if(i==0){
	ans=A[0]-1;
	continue;
      }
      else if(i=m-1){
	ans=max(ans,n-A[m-1]);
	cout << ans << endl;
	return 0;
      }
      else{
	if((A[i]-A[i-1])%2==0){
	  ans=max(ans,(A[i]-A[i-1])/2);
	}
	else{
	  ans=max(ans,(A[i]-A[i-1]/2+1));
	}
      }
    }
  }
  
  return 0;
}

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

int main() {
	int N, M;
	cin >> N >> M;
	long long int ans = LLONG_MIN / 6;
	long long int now;
	cin >> ans;
	now = ans;
	ans--;
	for( size_t i = 1; i < M; i++ ) {
		long long int a;
		cin >> a;
		ans = max( (a - now) / 2, ans );
		now = a;
	}
	ans = max( N - now, ans );
	cout << ans << endl;
}

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

#define int long long
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define Rep(i, n) for( int i = 0; i < (n); i++ )
#define Rrep(i, a, n) for( int i = (a); i < (n); i++ )
#define All(v) v.begin(), v.end()

typedef pair<int, int> Pii;
typedef pair<int, Pii> Pip;
const int INF = 1107110711071107;

signed main() {
    int n, m;
    cin >> n >> m;

    int a[100010];
    Rep(i, m) cin >> a[i];

    int mx = 0;
    for ( int i = 0; i < m-1; i++ ) {
        mx = max(mx, (a[i+1]-a[i]) / 2);
    }

    cout << max(mx, max(a[0]-1, n - a[m-1])) << endl;
}

C++: #include <stdio.h>

int main(void) {
  int m, n, i, j, be = 1, ans = 0, t;
  scanf("%d%d", &n, &m);
  for(i = 0; i < m; ++i) {
    scanf("%d", &t);
    if(!i) ans = t - 1;
    else if((t - be) / 2 > ans) ans = (t - be) / 2;
    be = t;
  }
  if(n - be > ans) ans = n - be;
  printf("%d\n", ans);
  return 0;
}

C++: #include<bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define mp make_pair
#define pb push_back
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define dbg(x) cerr<<__LINE__<<": "<<#x<<" = "<<(x)<<endl

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
const int inf = (int)1e9;
const double INF = 1e12, EPS = 1e-9;

int a[100000];

int main(){
	int n, m; cin >> n >> m;
	int ans = 0;
	rep(i, m) cin >> a[i];
	rep(i, m - 1) ans = max(ans, (a[i + 1] - a[i]) / 2);
	ans = max(ans, a[0] - 1);
	ans = max(ans, n - a[m - 1]);
	cout << ans << endl;
	return 0;
}

C++: #include<iostream>
#include<algorithm>

using namespace std;

int main() {

  int n, m, i, in, def = 0, ans = 0, before = 0;

  cin >> n >> m;
  
  for(i = 0; i < m; i++) {
    cin >> in;
    
    if(i == 0 && in != 1) {
      def = in - 1;
    }

    else def = (in-before)/2 +0.5;

    ans = max(ans, def);

    before = in;
  }

  ans = max(ans, n - in);
  cout << ans << endl;

  return 0;
}