#include <bits/stdc++.h>
using namespace std;
long long najveci(int n) { return ((long long)n * (n - 1) / 2); }
long long najmanji(int n) {
  return (najveci((n + 1) / 2) + najveci((n + 2) / 2));
}
int main() {
  int n, m, x, d, flat = 0, dpos = 0, dneg = 0;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> x >> d;
    flat += x;
    if (d > 0)
      dpos += d;
    else
      dneg += d;
  }
  long long jaje = (long long)flat * n + dpos * najveci(n) + dneg * najmanji(n);
  double xd = (double)jaje / n;
  printf("%.15lf\n", xd);
  return 0;
}
