#include <bits/stdc++.h>
using namespace std;
long long a[100005];
long double v(long double x) { return x * (x - 1) / 2; }
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  long double s = 0;
  long double aa[n];
  for (long long i = 1; i <= n; i++) {
    aa[i - 1] = v(i) + v(n - i + 1);
  }
  sort(aa, aa + n);
  long double q = n;
  for (long long i = 0; i < m; i++) {
    long double x, d;
    cin >> x >> d;
    long double y = max(d * aa[0], d * aa[n - 1]);
    s += q * x + y;
  }
  s /= q;
  cout << setprecision(10) << fixed << s;
}
