#include <bits/stdc++.h>
const int MAXINT = 2147483640;
const long long MAXLL = 9223372036854775800LL;
const long long MAXN = 29000000;
const double eps = 1e-9;
const long long mod = 1e9 + 7;
using namespace std;
long long binpow(long long a, long long n) {
  long long ans = 1;
  while (n) {
    if (n & 1) ans *= a;
    a *= a;
    n >>= 1;
  }
  return ans;
}
long long n, m;
long double ans = 0;
long long x, d, mx = -1e18, mn = 1e18, now;
int main() {
  srand(time(0));
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> n >> m;
  now = (n * (n + 1)) / 2 - n;
  for (int i = 1; i <= n; ++i) {
    mx = max(mx, now);
    mn = min(mn, now);
    now = (now + i);
    now = (now - (n - i));
  }
  for (int i = 1; i <= m; ++i) {
    cin >> x >> d;
    ans += double(x * n + max(d * mx, d * mn));
  }
  cout << fixed << setprecision(8) << double(ans / (double(n + 0.0))) << "\n";
  return 0;
}
