#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define ull unsigned long long
#define Toggle(n,i) (n^((ll)1<<i))
#define Check(n,i) (n&((ll)1<<i))
#define Set(n,i) (n|((ll)1<<i))
#define Reset(n,i) (n&(~((ll)1<<i)))
#define fo(a,x,y) for(int i=(x);i<=(y);++i){cout<<a[i]<<" ";}cout<<endl;
#define me(arr,val) memset(arr,val,sizeof arr)
#define inf INT_MAX
#define infd DBL_MAX
#define infl LLONG_MAX
#define mod 1000000007ll
#define f first
#define s second
#define pra(a) for(auto i:a){cout<<i<<endl;}
#define all2(a,start,n) a.begin()+start,a.begin()+start+n
#define all(a) a.begin(),a.end()
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
//int dx[]={+1,-1,0,0};//vertical horizontal
//int dy[]={0,0,+1,-1};//vertical horizontal
//int dx[]={+1,+1,-1,-1,+2,-2,+2,-2};//knights move
//int dy[]={+2,-2,+2,-2,+1,+1,-1,-1};//knights move
//int dx[]={+1,-1,0,0,+1,+1,-1,-1};//vertical horizontal diagonal
//int dy[]={0,0,+1,-1,-1,+1,+1,-1};//vertical horizontal diagonal
using namespace std;
using namespace __gnu_pbds;
/*typedef tree<int, null_type,less<int>, rb_tree_tag,
tree_order_statistics_node_update>indexed_set;
for set use above*/
typedef tree<pair<int,int>, null_type,less<pair<int, int>>, rb_tree_tag,
tree_order_statistics_node_update> indexed_multiset;
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
return os << "(" << p.first << ", " << p.second << ")";
}
template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
os << "{";
typename vector< T > :: const_iterator it;
for( it = v.begin(); it != v.end(); it++ ) {
if( it != v.begin() ) os << ", ";
os << *it;
}
return os << "}";
}
template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
os << "[";
typename set< T > :: const_iterator it;
for ( it = v.begin(); it != v.end(); it++ ) {
if( it != v.begin() ) os << ", ";
os << *it;
}
return os << "]";
}
template < typename T >
ostream &operator << ( ostream & os, const multiset< T > &v ) {
os << "[";
typename multiset< T > :: const_iterator it;
for ( it = v.begin(); it != v.end(); it++ ) {
if( it != v.begin() ) os << ", ";
os << *it;
}
return os << "]";
}
template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
os << "[";
typename map< F , S >::const_iterator it;
for( it = v.begin(); it != v.end(); it++ ) {
if( it != v.begin() ) os << ", ";
os << it -> first << " = " << it -> second ;
}
return os << "]";
}
#define pr(x) cerr << #x << " = " << x << endl;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll n,m,sum=0;
cin>>n>>m;
while(m--)
{
ll x,d;
cin>>x>>d;
if(d>=0)
{
sum+=d*((n*(n-1))/2)+x*n;
//pr(sum);
}
else
{
ll n2=(n-1)/2;
//pr(n2);
sum+=(d*((n2*(n2+1))/2))*2+x*n;
if(n%2==0)
sum+=(n/2)*d;
//pr(sum);
}
}
cout<<fixed<<setprecision(15)<<(double)sum/n;
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2RlZmluZSBJT1MgaW9zOjpzeW5jX3dpdGhfc3RkaW8oMCk7IGNpbi50aWUoMCk7IGNvdXQudGllKDApOwojZGVmaW5lIGxsIGxvbmcgbG9uZwojZGVmaW5lIHVsbCB1bnNpZ25lZCBsb25nIGxvbmcKI2RlZmluZSBUb2dnbGUobixpKSAobl4oKGxsKTE8PGkpKQojZGVmaW5lIENoZWNrKG4saSkgKG4mKChsbCkxPDxpKSkKI2RlZmluZSBTZXQobixpKSAobnwoKGxsKTE8PGkpKQojZGVmaW5lIFJlc2V0KG4saSkgKG4mKH4oKGxsKTE8PGkpKSkKI2RlZmluZSBmbyhhLHgseSkgZm9yKGludCBpPSh4KTtpPD0oeSk7KytpKXtjb3V0PDxhW2ldPDwiICI7fWNvdXQ8PGVuZGw7CiNkZWZpbmUgbWUoYXJyLHZhbCkgbWVtc2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To6c3luY193aXRoX3N0ZGlvKGZhbHNlKTsKICAgIGNpbi50aWUoTlVMTCk7CiAgICBsbCBuLG0sc3VtPTA7CiAgICBjaW4+Pm4+Pm07CiAgICB3aGlsZShtLS0pCiAgICB7CiAgICAgICAgbGwgeCxkOwogICAgICAgIGNpbj4+eD4+ZDsKICAgICAgICBpZihkPj0wKQogICAgICAgIHsKICAgICAgICAgICAgc3VtKz1kKigobioobi0xKSkvMikreCpuOwogICAgICAgICAgICAvL3ByKHN1bSk7CiAgICAgICAgfQogICAgICAgIGVsc2UKICAgICAgICB7CiAgICAgICAgICAgIGxsIG4yPShuLTEpLzI7CiAgICAgICAgICAgIC8vcHIobjIpOwogICAgICAgICAgICBzdW0rPShkKigobjIqKG4yKzEpKS8yKSkqMit4Km47CiAgICAgICAgICAgIGlmKG4lMj09MCkKICAgICAgICAgICAgICAgIHN1bSs9KG4vMikqZDsKICAgICAgICAgICAgLy9wcihzdW0pOwogICAgICAgIH0KICAgIH0KICAgIGNvdXQ8PGZpeGVkPDxzZXRwcmVjaXNpb24oMTUpPDwoZG91YmxlKXN1bS9uOwogICAgcmV0dXJuIDA7Cn0KCg==