/** * @FileName a.cpp * @Author kanpurin * @Created 2021.04.16 22:27:32 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { int n,m;cin >> n >> m; vector a(m); double plus = 0; for (int i = 0; i < m; i++) { cin >> a[i]; if (i == 0) plus += a[i]-1; else if (i == m-1) plus += n-a[i]; } double left = 0, right = 1000000000; double ans; int loop_cnt = 50; for (int t = 0; t < loop_cnt; t++) { double mid = (left+right)/2; vector dp(m,0); double sum = 0; for (int i = m-2; i >= 0; i--) { dp[i] = min(dp[i+1]+a[i+1]-a[i],mid+1); sum += dp[i]; } if (sum/m >= mid) { left = mid; } else { right = mid; } if (t == loop_cnt-1) ans = dp[0]; } printf("%.10f\n",ans+plus); return 0; }