#include #include "testlib.h" using namespace std; int n, m; long double res = 1e18; long double cost; long long base; int main() { registerValidation(); int n = inf.readInt(1, 1000000000); inf.readSpace(); int m = inf.readInt(1, min(n, 100000)); inf.readEoln(); vector b(m); int bef = 0; for(int i = 0; i < m; i++) { if(i) inf.readSpace(); b[i] = inf.readInt(bef + 1, n); bef = b[i]; } inf.readEoln(); inf.readEof(); if(m <= 1) { printf("%d\n", n - 1); return 0; } base += b.front() - 1 + n - b.back(); res = b.back() - b.front(); for(int i = m - 1; i >= 1; i--) { cost += b.back() - b[i]; res = min(res, cost / (m - i) + (long double)m / (m - i)); } cout << fixed << setprecision(6); cout << res + base << endl; }