Problem: Alice got an array of length n as a birthday present once again! This is the third year in a row! 

And what is more disappointing, it is overwhelmengly boring, filled entirely with zeros. Bob decided to apply some changes to the array to cheer up Alice.

Bob has chosen m changes of the following form. For some integer numbers x and d, he chooses an arbitrary position i (1 ≤ i ≤ n) and for every j ∈ [1, n] adds x + d ⋅ dist(i, j) to the value of the j-th cell. dist(i, j) is the distance between positions i and j (i.e. dist(i, j) = |i - j|, where |x| is an absolute value of x).

For example, if Alice currently has an array [2, 1, 2, 2] and Bob chooses position 3 for x = -1 and d = 2 then the array will become [2 - 1 + 2 ⋅ 2,~1 - 1 + 2 ⋅ 1,~2 - 1 + 2 ⋅ 0,~2 - 1 + 2 ⋅ 1] = [5, 2, 1, 3]. Note that Bob can't choose position i outside of the array (that is, smaller than 1 or greater than n).

Alice will be the happiest when the elements of the array are as big as possible. Bob claimed that the arithmetic mean value of the elements will work fine as a metric.

What is the maximum arithmetic mean value Bob can achieve?

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 10^5) — the number of elements of the array and the number of changes.

Each of the next m lines contains two integers x_i and d_i (-10^3 ≤ x_i, d_i ≤ 10^3) — the parameters for the i-th change.

Output

Print the maximal average arithmetic mean of the elements Bob can achieve.

Your answer is considered correct if its absolute or relative error doesn't exceed 10^{-6}.

Examples

Input

2 3
-1 3
0 0
-1 -4


Output

-2.500000000000000


Input

3 2
0 2
5 0


Output

7.000000000000000

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
struct big_integer {
  static const int base = 1000;
  static const int width = 3;
  vector<int> v;
  bool is_negative;
  big_integer(long long num = 0) {
    *this = num;
    is_negative = false;
  }
  big_integer operator=(long long val) {
    v.clear();
    if (val < 0) {
      val = -val;
      is_negative = true;
    } else
      is_negative = false;
    do {
      v.push_back(val % base);
      val /= base;
    } while (val > 0);
    return *this;
  }
  big_integer operator=(const string &str) {
    v.clear();
    string str2 = str;
    if (str2[0] == '-') {
      is_negative = true;
      for (string::iterator i = str2.begin(); i < str2.end() - 1; i++) {
        *i = *(i + 1);
      }
      *(str2.end() - 1) = '\0';
      str2.resize(str2.length() - 1);
      str2.shrink_to_fit();
    }
    int cur, len = (str2.length() - 1) / width + 1;
    for (int i = 0; i < len; i++) {
      int end = str2.length() - i * width;
      int begin = max(0, end - width);
      sscanf(str2.substr(begin, end - begin).c_str(), "%d", &cur);
      v.push_back(cur);
    }
    return *this;
  }
  big_integer operator+(const big_integer &addend) const {
    big_integer sum;
    sum.v.clear();
    if (is_negative == true) {
      if (addend.is_negative == true)
        sum.is_negative = true;
      else
        return addend - (-*this);
    } else if (addend.is_negative == true) {
      return *this - (-addend);
    }
    for (int i = 0, carry = 0;
         carry != 0 || i < v.size() || i < addend.v.size(); i++) {
      int cur = carry;
      if (i < v.size()) cur += v[i];
      if (i < addend.v.size()) cur += addend.v[i];
      carry = cur / base;
      cur %= base;
      sum.v.push_back(cur);
    }
    return sum;
  }
  big_integer operator-(const big_integer &subtrahend) const {
    big_integer difference;
    difference.v.clear();
    if (is_negative == false && subtrahend.is_negative == false &&
        *this < subtrahend)
      return -(subtrahend - *this);
    if (is_negative == true && subtrahend.is_negative == false)
      return -(-*this + subtrahend);
    else if (is_negative == false && subtrahend.is_negative == true)
      return *this + (-subtrahend);
    else if (is_negative == true && subtrahend.is_negative == true)
      return -subtrahend - (-*this);
    for (int i = 0, carry = 0; carry != 0 || i < v.size(); i++) {
      int cur = v[i] + carry;
      if (i < subtrahend.v.size()) cur -= subtrahend.v[i];
      if (cur >= 0)
        carry = 0;
      else {
        carry = -1;
        cur += base;
      }
      difference.v.push_back(cur);
    }
    for (int i = difference.v.size() - 1; i >= 0; i--) {
      if (difference.v[i] == 0)
        difference.v.resize(difference.v.size() - 1);
      else
        break;
    }
    difference.v.shrink_to_fit();
    if (difference.v.size() == 0) difference.v.resize(1, 0);
    return difference;
  }
  big_integer operator-() const {
    big_integer big_int = *this;
    big_int.is_negative = !(is_negative);
    return big_int;
  }
  big_integer operator*(const big_integer &multiplier) const {
    big_integer product;
    product.v.clear();
    if (is_negative != multiplier.is_negative) product.is_negative = true;
    for (int i = 0; i < v.size(); i++) {
      for (int j = 0; j < multiplier.v.size(); j++) {
        if (i + j >= product.v.size()) product.v.resize(i + j + 1, 0);
        product.v[i + j] += this->v[i] * multiplier.v[j];
        if (product.v[i + j] >= base) {
          if (i + j + 1 >= product.v.size()) product.v.resize(i + j + 1 + 1, 0);
          product.v[i + j + 1] += product.v[i + j] / base;
          product.v[i + j] %= base;
        }
      }
    }
    for (int i = product.v.size() - 1; i >= 0; i--) {
      if (product.v[i] == 0)
        product.v.resize(product.v.size() - 1);
      else
        break;
    }
    product.v.shrink_to_fit();
    if (product.v.size() == 0) product.v.resize(1, 0);
    return product;
  }
  bool operator<(const big_integer &big_int) const {
    if (is_negative == true && big_int.is_negative == false) return true;
    if (is_negative == false && big_int.is_negative == true) return false;
    if (is_negative == true && big_int.is_negative == true) {
      big_integer big_int1, big_int2;
      big_int1 = *this;
      big_int1.is_negative = false;
      big_int2 = big_int;
      big_int2.is_negative = false;
      return big_int2 < big_int1;
    }
    if (v.size() != big_int.v.size()) return v.size() < big_int.v.size();
    for (int i = v.size() - 1; i >= 0; i--) {
      if (v[i] != big_int.v[i]) return v[i] < big_int.v[i];
    }
    return false;
  }
  friend istream &operator>>(istream &in, big_integer &big_int) {
    string str;
    if (!(in >> str)) return in;
    big_int = str;
    return in;
  }
  friend ostream &operator<<(ostream &out, big_integer &big_int) {
    if (big_int.is_negative == true) out << '-';
    out << big_int.v.back();
    for (int i = big_int.v.size() - 1 - 1; i >= 0; i--) {
      char str[base + 5];
      sprintf(str, "%0*d", width, big_int.v[i]);
      out << str;
    }
    return out;
  }
};
long long n, m;
big_integer sum = 0;
long long x, d;
big_integer bi;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> x >> d;
    bi = x * n, sum = sum + bi;
    if (d < 0) {
      if (n % 2 == 0)
        bi = d * n * n / 4;
      else
        bi = d * (n * n - 1) / 4;
    } else
      bi = d * n * (n - 1) / 2;
    sum = sum + bi;
  }
  big_integer quotient = 0;
  long long remainder = 0;
  for (int i = sum.v.size() - 1; i >= 0; i--) {
    remainder = remainder * sum.base + sum.v[i];
    quotient = quotient * sum.base + remainder / n;
    remainder = remainder - remainder / n * n;
  }
  for (int i = quotient.v.size() - 1; i >= 0; i--) {
    if (quotient.v[i] == 0)
      quotient.v.resize(quotient.v.size() - 1);
    else
      break;
  }
  quotient.v.shrink_to_fit();
  if (quotient.v.size() == 0) quotient.v.resize(1, 0);
  long double frac = (long double)(1.0 * remainder / n);
  string fracs = to_string(frac);
  if (sum.is_negative == true) cout << '-';
  cout << quotient;
  cout << fracs.substr(1, fracs.length() - 1) << '\n';
  return 0;
}