#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include typedef int64_t ll; typedef std::pair Pii; typedef std::pair Pll; typedef std::pair Pdd; #define rip(_i, _n, _s) for (int _i = (_s); _i < (int)(_n); _i++) #define all(_l) _l.begin(), _l.end() #define rall(_l) _l.rbegin(), _l.rend() #define MM << " " << template using MaxHeap = std::priority_queue<_T>; template using MinHeap = std::priority_queue<_T, std::vector<_T>, std::greater<_T>>; template inline bool chmax(_T &_l, const _T _b) { if (_l < _b) { _l = _b; return true; } return false; } template inline bool chmin(_T &_l, const _T _b) { if (_l > _b) { _l = _b; return true; } return false; } template void vdeb(const std::vector<_T> &bb) { for (unsigned int i = 0;i < bb.size();i++) { if (i == bb.size() - 1) std::cout << bb[i]; else std::cout << bb[i] << ' '; } std::cout << '\n'; } template void vdeb(const std::vector> &bb) { for (unsigned int i = 0;i < bb.size();i++) { std::cout << i << ' '; vdeb(bb[i]); } std::cout << '\n'; } using namespace std; int main() { int n, m; cin >> n >> m; vector da(m); rip(i,m,0) cin >> da[i]; long double ok = 1e10, ng = 0; rip(i,60,0) { long double now = (ok + ng)/2, su = 0; rip(i,m,0) { if(n-da[i] > now) su += now; else su += n-da[i]; } if(su/m + 1.0 <= now) { ok = now; } else { ng = now; } } printf("%.04Lf\n", min(ok+da[0]-1, (long double)n-1)); }