#include <bits/stdc++.h>
using namespace std;
double ave;
int n, m, sump, sumn;
long long Max, Min, sum[100010];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1, x, d; i <= m; ++i) {
    scanf("%d%d", &x, &d);
    ave += x;
    if (d > 0)
      sump += d;
    else
      sumn += d;
  }
  for (int i = 1; i <= n; ++i) sum[i] = sum[i - 1] + 1ll * i;
  Max = -1;
  Min = 1e18;
  for (int i = 1; i <= n; ++i) {
    Max = max(Max, sum[i - 1] + sum[n - i]);
    Min = min(Min, sum[i - 1] + sum[n - i]);
  }
  ave += 1. * Max * sump / n;
  ave += 1. * Min * sumn / n;
  printf("%.10lf\n", ave);
  return 0;
}
