/** Micro Mezz Macro Flation -- Overheated Economy ., Last Update: Nov. 7th 2013 **/ //{

/** Header .. **/ //{
#pragma comment(linker, "/STACK:36777216")
//#pragma GCC optimize ("O2")
#define LOCAL
//#include "testlib.h"
#include <functional>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <cstring>
#include <climits>
#include <cassert>
#include <complex>
#include <cstdio>
#include <string>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <list>
#include <set>
#include <map>

//#include <tr1/unordered_set>
//#include <tr1/unordered_map>
//#include <array>

using namespace std;

#define REP(i, n) for (int i=0;i<n;++i)
#define FOR(i, a, b) for (int i=a;i<b;++i)
#define DWN(i, b, a) for (int i=b-1;i>=a;--i)
#define REP_1(i, n) for (int i=1;i<=n;++i)
#define FOR_1(i, a, b) for (int i=a;i<=b;++i)
#define DWN_1(i, b, a) for (int i=b;i>=a;--i)
#define REP_C(i, n) for (int n____=n,i=0;i<n____;++i)
#define FOR_C(i, a, b) for (int b____=b,i=a;i<b____;++i)
#define DWN_C(i, b, a) for (int a____=a,i=b-1;i>=a____;--i)
#define REP_N(i, n) for (i=0;i<n;++i)
#define FOR_N(i, a, b) for (i=a;i<b;++i)
#define DWN_N(i, b, a) for (i=b-1;i>=a;--i)
#define REP_1_C(i, n) for (int n____=n,i=1;i<=n____;++i)
#define FOR_1_C(i, a, b) for (int b____=b,i=a;i<=b____;++i)
#define DWN_1_C(i, b, a) for (int a____=a,i=b;i>=a____;--i)
#define REP_1_N(i, n) for (i=1;i<=n;++i)
#define FOR_1_N(i, a, b) for (i=a;i<=b;++i)
#define DWN_1_N(i, b, a) for (i=b;i>=a;--i)
#define REP_C_N(i, n) for (int n____=(i=0,n);i<n____;++i)
#define FOR_C_N(i, a, b) for (int b____=(i=0,b);i<b____;++i)
#define DWN_C_N(i, b, a) for (int a____=(i=b-1,a);i>=a____;--i)
#define REP_1_C_N(i, n) for (int n____=(i=1,n);i<=n____;++i)
#define FOR_1_C_N(i, a, b) for (int b____=(i=1,b);i<=b____;++i)
#define DWN_1_C_N(i, b, a) for (int a____=(i=b,a);i>=a____;--i)

#define ECH(it, A) for (__typeof(A.begin()) it=A.begin(); it != A.end(); ++it)
#define REP_S(i, str) for (char*i=str;*i;++i)
#define REP_L(i, hd, suc) for (int i=hd;i;i=suc[i])
#define REP_G(i, u) REP_L(i,hd[u],suc)
#define REP_SS(x, s) for (int x=s;x;x=(x-1)&s)
#define DO(n) for ( int ____n = n; ____n-->0; )
#define REP_2(i, j, n, m) REP(i, n) REP(j, m)
#define REP_2_1(i, j, n, m) REP_1(i, n) REP_1(j, m)
#define REP_3(i, j, k, n, m, l) REP(i, n) REP(j, m) REP(k, l)
#define REP_3_1(i, j, k, n, m, l) REP_1(i, n) REP_1(j, m) REP_1(k, l)
#define REP_4(i, j, k, ii, n, m, l, nn) REP(i, n) REP(j, m) REP(k, l) REP(ii, nn)
#define REP_4_1(i, j, k, ii, n, m, l, nn) REP_1(i, n) REP_1(j, m) REP_1(k, l) REP_1(ii, nn)

#define ALL(A) A.begin(), A.end()
#define LLA(A) A.rbegin(), A.rend()
#define CPY(A, B) memcpy(A, B, sizeof(A))
#define INS(A, P, B) A.insert(A.begin() + P, B)
#define ERS(A, P) A.erase(A.begin() + P)
#define LBD(A, x) (lower_bound(ALL(A), x) - A.begin())
#define UBD(A, x) (lower_bound(ALL(A), x) - A.begin())
#define CTN(T, x) (T.find(x) != T.end())
#define SZ(A) int((A).size())
#define PB push_back
#define MP(A, B) make_pair(A, B)
#define PTT pair<T, T>
#define Ts *this
#define rTs return Ts
#define fi first
#define se second
#define re real()
#define im imag()

#define Rush for(int ____T=RD(); ____T--;)
#define Display(A, n, m) {                      \
  REP(i, n){		                            \
        REP(j, m-1) cout << A[i][j] << " ";     \
        cout << A[i][m-1] << endl;		        \
	}						                    \
}
#define Display_1(A, n, m) {                    \
	REP_1(i, n){		                        \
        REP_1(j, m-1) cout << A[i][j] << " ";   \
        cout << A[i][m] << endl;		        \
	}						                    \
}

typedef long long LL;
//typedef long double DB;
typedef double DB;
typedef unsigned uint;
typedef unsigned long long uLL;

typedef vector<int> VI;
typedef vector<char> VC;
typedef vector<string> VS;
typedef vector<LL> VL;
typedef vector<DB> VF;
typedef set<int> SI;
typedef set<string> SS;
typedef map<int, int> MII;
typedef map<string, int> MSI;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef vector<VII> VVII;

template<class T> inline T& RD(T &);
template<class T> inline void OT(const T &);
//inline int RD(){int x; return RD(x);}
inline LL RD(){LL x; return RD(x);}
inline DB& RF(DB &);
inline DB RF(){DB x; return RF(x);}
inline char* RS(char *s);
inline char& RC(char &c);
inline char RC();
inline char& RC(char &c){scanf(" %c", &c); return c;}
inline char RC(){char c; return RC(c);}
//inline char& RC(char &c){c = getchar(); return c;}
//inline char RC(){return getchar();}

template<class T> inline T& RDD(T &);
inline LL RDD(){LL x; return RDD(x);}

template<class T0, class T1> inline T0& RD(T0 &x0, T1 &x1){RD(x0), RD(x1); return x0;}
template<class T0, class T1, class T2> inline T0& RD(T0 &x0, T1 &x1, T2 &x2){RD(x0), RD(x1), RD(x2); return x0;}
template<class T0, class T1, class T2, class T3> inline T0& RD(T0 &x0, T1 &x1, T2 &x2, T3 &x3){RD(x0), RD(x1), RD(x2), RD(x3); return x0;}
template<class T0, class T1, class T2, class T3, class T4> inline T0& RD(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4){RD(x0), RD(x1), RD(x2), RD(x3), RD(x4); return x0;}
template<class T0, class T1, class T2, class T3, class T4, class T5> inline T0& RD(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4, T5 &x5){RD(x0), RD(x1), RD(x2), RD(x3), RD(x4), RD(x5); return x0;}
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline T0& RD(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4, T5 &x5, T6 &x6){RD(x0), RD(x1), RD(x2), RD(x3), RD(x4), RD(x5), RD(x6); return x0;}
template<class T0, class T1> inline void OT(const T0 &x0, const T1 &x1){OT(x0), OT(x1);}
template<class T0, class T1, class T2> inline void OT(const T0 &x0, const T1 &x1, const T2 &x2){OT(x0), OT(x1), OT(x2);}
template<class T0, class T1, class T2, class T3> inline void OT(const T0 &x0, const T1 &x1, const T2 &x2, const T3 &x3){OT(x0), OT(x1), OT(x2), OT(x3);}
template<class T0, class T1, class T2, class T3, class T4> inline void OT(const T0 &x0, const T1 &x1, const T2 &x2, const T3 &x3, const T4 &x4){OT(x0), OT(x1), OT(x2), OT(x3), OT(x4);}
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void OT(const T0 &x0, const T1 &x1, const T2 &x2, const T3 &x3, const T4 &x4, const T5 &x5){OT(x0), OT(x1), OT(x2), OT(x3), OT(x4), OT(x5);}
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void OT(const T0 &x0, const T1 &x1, const T2 &x2, const T3 &x3, const T4 &x4, const T5 &x5, const T6 &x6){OT(x0), OT(x1), OT(x2), OT(x3), OT(x4), OT(x5), OT(x6);}
inline char& RC(char &a, char &b){RC(a), RC(b); return a;}
inline char& RC(char &a, char &b, char &c){RC(a), RC(b), RC(c); return a;}
inline char& RC(char &a, char &b, char &c, char &d){RC(a), RC(b), RC(c), RC(d); return a;}
inline char& RC(char &a, char &b, char &c, char &d, char &e){RC(a), RC(b), RC(c), RC(d), RC(e); return a;}
inline char& RC(char &a, char &b, char &c, char &d, char &e, char &f){RC(a), RC(b), RC(c), RC(d), RC(e), RC(f); return a;}
inline char& RC(char &a, char &b, char &c, char &d, char &e, char &f, char &g){RC(a), RC(b), RC(c), RC(d), RC(e), RC(f), RC(g); return a;}
inline DB& RF(DB &a, DB &b){RF(a), RF(b); return a;}
inline DB& RF(DB &a, DB &b, DB &c){RF(a), RF(b), RF(c); return a;}
inline DB& RF(DB &a, DB &b, DB &c, DB &d){RF(a), RF(b), RF(c), RF(d); return a;}
inline DB& RF(DB &a, DB &b, DB &c, DB &d, DB &e){RF(a), RF(b), RF(c), RF(d), RF(e); return a;}
inline DB& RF(DB &a, DB &b, DB &c, DB &d, DB &e, DB &f){RF(a), RF(b), RF(c), RF(d), RF(e), RF(f); return a;}
inline DB& RF(DB &a, DB &b, DB &c, DB &d, DB &e, DB &f, DB &g){RF(a), RF(b), RF(c), RF(d), RF(e), RF(f), RF(g); return a;}
inline void RS(char *s1, char *s2){RS(s1), RS(s2);}
inline void RS(char *s1, char *s2, char *s3){RS(s1), RS(s2), RS(s3);}
template<class T0,class T1>inline void RDD(T0&a, T1&b){RDD(a),RDD(b);}
template<class T0,class T1,class T2>inline void RDD(T0&a, T1&b, T2&c){RDD(a),RDD(b),RDD(c);}

template<class T> inline void RST(T &A){memset(A, 0, sizeof(A));}
template<class T> inline void FLC(T &A, int x){memset(A, x, sizeof(A));}
template<class T> inline void CLR(T &A){A.clear();}

template<class T0, class T1> inline void RST(T0 &A0, T1 &A1){RST(A0), RST(A1);}
template<class T0, class T1, class T2> inline void RST(T0 &A0, T1 &A1, T2 &A2){RST(A0), RST(A1), RST(A2);}
template<class T0, class T1, class T2, class T3> inline void RST(T0 &A0, T1 &A1, T2 &A2, T3 &A3){RST(A0), RST(A1), RST(A2), RST(A3);}
template<class T0, class T1, class T2, class T3, class T4> inline void RST(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4){RST(A0), RST(A1), RST(A2), RST(A3), RST(A4);}
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void RST(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5){RST(A0), RST(A1), RST(A2), RST(A3), RST(A4), RST(A5);}
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void RST(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5, T6 &A6){RST(A0), RST(A1), RST(A2), RST(A3), RST(A4), RST(A5), RST(A6);}
template<class T0, class T1> inline void FLC(T0 &A0, T1 &A1, int x){FLC(A0, x), FLC(A1, x);}
template<class T0, class T1, class T2> inline void FLC(T0 &A0, T1 &A1, T2 &A2, int x){FLC(A0, x), FLC(A1, x), FLC(A2, x);}
template<class T0, class T1, class T2, class T3> inline void FLC(T0 &A0, T1 &A1, T2 &A2, T3 &A3, int x){FLC(A0, x), FLC(A1, x), FLC(A2, x), FLC(A3, x);}
template<class T0, class T1, class T2, class T3, class T4> inline void FLC(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, int x){FLC(A0, x), FLC(A1, x), FLC(A2, x), FLC(A3, x), FLC(A4, x);}
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void FLC(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5, int x){FLC(A0, x), FLC(A1, x), FLC(A2, x), FLC(A3, x), FLC(A4, x), FLC(A5, x);}
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void FLC(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5, T6 &A6, int x){FLC(A0, x), FLC(A1, x), FLC(A2, x), FLC(A3, x), FLC(A4, x), FLC(A5, x), FLC(A6, x);}
template<class T> inline void CLR(priority_queue<T, vector<T>, less<T> > &Q){while (!Q.empty()) Q.pop();}
template<class T> inline void CLR(priority_queue<T, vector<T>, greater<T> > &Q){while (!Q.empty()) Q.pop();}
template<class T> inline void CLR(stack<T> &S){while (!S.empty()) S.pop();}

template<class T0, class T1> inline void CLR(T0 &A0, T1 &A1){CLR(A0), CLR(A1);}
template<class T0, class T1, class T2> inline void CLR(T0 &A0, T1 &A1, T2 &A2){CLR(A0), CLR(A1), CLR(A2);}
template<class T0, class T1, class T2, class T3> inline void CLR(T0 &A0, T1 &A1, T2 &A2, T3 &A3){CLR(A0), CLR(A1), CLR(A2), CLR(A3);}
template<class T0, class T1, class T2, class T3, class T4> inline void CLR(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4){CLR(A0), CLR(A1), CLR(A2), CLR(A3), CLR(A4);}
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void CLR(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5){CLR(A0), CLR(A1), CLR(A2), CLR(A3), CLR(A4), CLR(A5);}
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void CLR(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5, T6 &A6){CLR(A0), CLR(A1), CLR(A2), CLR(A3), CLR(A4), CLR(A5), CLR(A6);}
template<class T> inline void CLR(T &A, int n){REP(i, n) CLR(A[i]);}

template<class T> inline bool EPT(T &a){return a.empty();}
template<class T> inline T& SRT(T &A){sort(ALL(A)); return A;}
template<class T, class C> inline T& SRT(T &A, C B){sort(ALL(A), B); return A;}
template<class T> inline T& RVS(T &A){reverse(ALL(A)); return A;}
template<class T> inline T& UNQQ(T &A){A.resize(unique(ALL(A))-A.begin());return A;}
template<class T> inline T& UNQ(T &A){SRT(A);return UNQQ(A);}

//}

/** Constant List .. **/ //{

const int MOD = int(1e9) + 7;
const int INF = 0x3f3f3f3f;
const LL INFF = 0x3f3f3f3f3f3f3f3fLL;
const DB EPS = 1e-9;
const DB OO = 1e20;
const DB PI = acos(-1.0); //M_PI;

const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};

//}

/** Add On .. **/ //{
// <<= '0. Nichi Joo ., //{

template<class T> inline T& checkMin(T &a,const T b){if (b<a) a=b;return a;}
template<class T> inline T& checkMax(T &a,const T b){if (a<b) a=b;return a;}
template<class T> inline T& checkMin(T &a, T &b, const T x){checkMin(a, x), checkMin(b, x);return a;}
template<class T> inline T& checkMax(T &a, T &b, const T x){checkMax(a, x), checkMax(b, x);return a;}
template <class T, class C> inline T& checkMin(T& a, const T b, C c){if (c(b,a)) a = b;return a;}
template <class T, class C> inline T& checkMax(T& a, const T b, C c){if (c(a,b)) a = b;return a;}
template<class T> inline T min(T a, T b, T c){return min(min(a, b), c);}
template<class T> inline T max(T a, T b, T c){return max(max(a, b), c);}
template<class T> inline T min(T a, T b, T c, T d){return min(min(a, b), min(c, d));}
template<class T> inline T max(T a, T b, T c, T d){return max(max(a, b), max(c, d));}
template<class T> inline T min(T a, T b, T c, T d, T e){return min(min(min(a,b),min(c,d)),e);}
template<class T> inline T max(T a, T b, T c, T d, T e){return max(max(max(a,b),max(c,d)),e);}
template<class T> inline T sqr(T a){return a*a;}
template<class T> inline T cub(T a){return a*a*a;}
template<class T> inline T ceil(T x, T y){return (x - 1) / y + 1;}
template<class T> T abs(T x){return x>0?x:-x;}
inline int sgn(DB x){return x < -EPS ? -1 : x > EPS;}
inline int sgn(DB x, DB y){return sgn(x - y);}

inline DB cos(DB a, DB b, DB c){return (sqr(a)+sqr(b)-sqr(c))/(2*a*b);}
inline DB cot(DB x){return 1./tan(x);};
inline DB sec(DB x){return 1./cos(x);};
inline DB csc(DB x){return 1./sin(x);};

//}
// <<= '1. Bitwise Operation ., //{
namespace BO{

inline bool _1(int x, int i){return bool(x&1<<i);}
inline bool _1(LL x, int i){return bool(x&1LL<<i);}
inline LL _1(int i){return 1LL<<i;}
inline LL _U(int i){return _1(i) - 1;};

inline int reverse_bits(int x){
    x = ((x >> 1) & 0x55555555) | ((x << 1) & 0xaaaaaaaa);
    x = ((x >> 2) & 0x33333333) | ((x << 2) & 0xcccccccc);
    x = ((x >> 4) & 0x0f0f0f0f) | ((x << 4) & 0xf0f0f0f0);
    x = ((x >> 8) & 0x00ff00ff) | ((x << 8) & 0xff00ff00);
    x = ((x >>16) & 0x0000ffff) | ((x <<16) & 0xffff0000);
    return x;
}

inline LL reverse_bits(LL x){
    x = ((x >> 1) & 0x5555555555555555LL) | ((x << 1) & 0xaaaaaaaaaaaaaaaaLL);
    x = ((x >> 2) & 0x3333333333333333LL) | ((x << 2) & 0xccccccccccccccccLL);
    x = ((x >> 4) & 0x0f0f0f0f0f0f0f0fLL) | ((x << 4) & 0xf0f0f0f0f0f0f0f0LL);
    x = ((x >> 8) & 0x00ff00ff00ff00ffLL) | ((x << 8) & 0xff00ff00ff00ff00LL);
    x = ((x >>16) & 0x0000ffff0000ffffLL) | ((x <<16) & 0xffff0000ffff0000LL);
    x = ((x >>32) & 0x00000000ffffffffLL) | ((x <<32) & 0xffffffff00000000LL);
    return x;
}

template<class T> inline bool odd(T x){return x&1;}
template<class T> inline bool even(T x){return !odd(x);}
template<class T> inline T low_bit(T x) {return x & -x;}
template<class T> inline T high_bit(T x) {T p = low_bit(x);while (p != x) x -= p, p = low_bit(x);return p;}
template<class T> inline T cover_bit(T x){T p = 1; while (p < x) p <<= 1;return p;}
template<class T> inline int cover_idx(T x){int p = 0; while (_1(p) < x ) ++p; return p;}

inline int clz(int x){return __builtin_clz(x);}
inline int clz(LL x){return __builtin_clzll(x);}
inline int ctz(int x){return __builtin_ctz(x);}
inline int ctz(LL x){return __builtin_ctzll(x);}
inline int lg2(int x){return !x ? -1 : 31 - clz(x);}
inline int lg2(LL x){return !x ? -1 : 63 - clz(x);}
inline int low_idx(int x){return !x ? -1 : ctz(x);}
inline int low_idx(LL x){return !x ? -1 : ctz(x);}
inline int high_idx(int x){return lg2(x);}
inline int high_idx(LL x){return lg2(x);}
inline int parity(int x){return __builtin_parity(x);}
inline int parity(LL x){return __builtin_parityll(x);}
inline int count_bits(int x){return __builtin_popcount(x);}
inline int count_bits(LL x){return __builtin_popcountll(x);}

} using namespace BO;//}
// <<= '9. Comutational Geometry .,//{
namespace CG{

#define cPo const Po&
#define cLine const Line&
#define cSeg const Seg&

inline DB dist2(DB x,DB y){return sqr(x)+sqr(y);}

struct Po{
    DB x,y;Po(DB x=0,DB y=0):x(x),y(y){}

    void in(){RF(x,y);}void out(){printf("(%.2f,%.2f)",x,y);}
    inline friend istream&operator>>(istream&i,Po&p){return i>>p.x>>p.y;}
    inline friend ostream&operator<<(ostream&o,Po p){return o<<"("<<p.x<<", "<<p.y<< ")";}

    Po operator-()const{return Po(-x,-y);}
    Po&operator+=(cPo p){x+=p.x,y+=p.y;rTs;}Po&operator-=(cPo p){x-=p.x,y-=p.y;rTs;}
    Po&operator*=(DB k){x*=k,y*=k;rTs;}Po&operator/=(DB k){x/=k,y/=k;rTs;}
    Po&operator*=(cPo p){rTs=Ts*p;}Po&operator/=(cPo p){rTs=Ts/p;}
    Po operator+(cPo p)const{return Po(x+p.x,y+p.y);}Po operator-(cPo p)const{return Po(x-p.x,y-p.y);}
    Po operator*(DB k)const{return Po(x*k,y*k);}Po operator/(DB k)const{return Po(x/k,y/k);}
    Po operator*(cPo p)const{return Po(x*p.x-y*p.y,y*p.x+x*p.y);}Po operator/(cPo p)const{return Po(x*p.x+y*p.y,y*p.x-x*p.y)/p.len2();}

    bool operator==(cPo p)const{return!sgn(x,p.x)&&!sgn(y,p.y);};bool operator!=(cPo p)const{return sgn(x,p.x)||sgn(y,p.y);}
    bool operator<(cPo p)const{return sgn(x,p.x)<0||!sgn(x,p.x)&&sgn(y,p.y)<0;}bool operator<=(cPo p)const{return sgn(x,p.x)<0||!sgn(x,p.x)&&sgn(y,p.y)<=0;}
    bool operator>(cPo p)const{return!(Ts<=p);}bool operator >=(cPo p)const{return!(Ts<p);}

    DB len2()const{return dist2(x,y);}DB len()const{return sqrt(len2());}DB arg()const{return atan2(y,x);}
    Po&_1(){rTs/=len();}Po&conj(){y=-y;rTs;}Po&lt(){swap(x,y),x=-x;rTs;}Po&rt(){swap(x,y),y=-y;rTs;}
    Po&rot(DB a,cPo o=Po()){Ts-=o;Ts*=Po(cos(a),sin(a));rTs+=o;}
};

inline DB dot(DB x1,DB y1,DB x2,DB y2){return x1*x2+y1*y2;}
inline DB dot(cPo a,cPo b){return dot(a.x,a.y,b.x,b.y);}
inline DB dot(cPo p0,cPo p1,cPo p2){return dot(p1-p0,p2-p0);}
inline DB det(DB x1,DB y1,DB x2,DB y2){return x1*y2-x2*y1;}
inline DB det(cPo a,cPo b){return det(a.x,a.y,b.x,b.y);}
inline DB det(cPo p0,cPo p1,cPo p2){return det(p1-p0,p2-p0);}
inline DB ang(cPo p0,cPo p1){return acos(dot(p0,p1)/p0.len()/p1.len());}
inline DB ang(cPo p0,cPo p1,cPo p2){return ang(p1-p0,p2-p0);}
inline DB ang(cPo p0,cPo p1,cPo p2,cPo p3){return ang(p1-p0,p3-p2);}
inline DB dist2(const Po &a, const Po &b){return dist2(a.x-b.x, a.y-b.y);}
template<class T1, class T2> inline int dett(const T1 &x, const T2 &y){return sgn(det(x, y));}
template<class T1, class T2, class T3> inline int dett(const T1 &x, const T2 &y, const T3 &z){return sgn(det(x, y, z));}
template<class T1, class T2, class T3, class T4> inline int dett(const T1 &x, const T2 &y, const T3 &z, const T4 &w){return sgn(det(x, y, z, w));}
template<class T1, class T2> inline int dott(const T1 &x, const T2 &y){return sgn(dot(x, y));}
template<class T1, class T2, class T3> inline int dott(const T1 &x, const T2 &y, const T3 &z){return sgn(dot(x, y, z));}
template<class T1, class T2, class T3, class T4> inline int dott(const T1 &x, const T2 &y, const T3 &z, const T4 &w){return sgn(dot(x, y, z, w));}
template<class T1, class T2> inline DB arg(const T1 &x, const T2 &y){DB a=ang(x,y);return~dett(x,y)?a:2*PI-a;}
template<class T1, class T2, class T3> inline DB arg(const T1 &x, const T2 &y, const T3 &z){DB a=ang(x,y,z);return~dett(x,y,z)?a:2*PI-a;}
template<class T1, class T2, class T3, class T4> inline DB arg(const T1 &x, const T2 &y, const T3 &z, const T4 &w){DB a=ang(x,y,z,w);return~dett(x,y,z,w)?a:2*PI-a;}
template<class T1, class T2> inline DB dist(const T1 &x, const T2 &y){return sqrt(dist2(x, y));}
template<class T1, class T2, class T3> inline DB dist(const T1 &x, const T2 &y, const T3 &z){return sqrt(dist2(x, y, z));}
inline Po _1(Po p){return p._1();}inline Po conj(Po p){return p.conj();}
inline Po lt(Po p){return p.lt();}inline Po rt(Po p){return p.rt();}
inline Po rot(Po p,DB a,cPo o=Po()){return p.rot(a,o);}
inline Po operator *(DB k,cPo p){return p*k;}
inline Po operator /(DB k,cPo p){return conj(p)*k/p.len2();}

typedef vector<Po> VP;

struct Line{
    Po a,b;Line(cPo a=Po(),cPo b=Po()):a(a),b(b){}
    Line(DB x0,DB y0,DB x1,DB y1):a(Po(x0,y0)),b(Po(x1,y1)){}
    Line(cLine l):a(l.a),b(l.b){}

    //Ax+By+C=0
    Line(DB A,DB B,DB C){
        C=-C;if(!::sgn(A))a=Po(0,C/B),b=Po(1,C/B);
        else if(!::sgn(B))a=Po(C/A,0),b=Po(C/A,1);
        else a=Po(0,C/B),b=Po(1,(C-A)/B);
    }

    void in(){a.in(),b.in();}
    inline friend istream&operator>>(istream&i,Line& p){return i>>p.a>>p.b;}
    inline friend ostream&operator<<(ostream&o,Line p){return o<<p.a<<"-"<< p.b;}

    Line operator+(cPo x)const{return Line(a+x,b+x);}
    Line operator-(cPo x)const{return Line(a-x,b-x);}
    Line operator*(DB k)const{return Line(a*k,b*k);}
    Line operator/(DB k)const{return Line(a/k,b/k);}

    Po operator*(cLine)const;
    Po d()const{return b-a;}DB len2()const{return d().len2();}DB len()const{return d().len();}DB arg()const{return d().arg();}

    int sgn(cPo p)const{return dett(a, b, p);}
    int sgn(cLine)const;

    bool sameSgn(cPo  p1,cPo  p2)const{return sgn(p1)==sgn(p2);}
    void getEquation(DB&K,DB&B)const{
        K = ::sgn(a.x, b.x) ? (b.y-a.y)/(b.x-a.x) : OO;
        B = a.y - K*a.x;
    }
    void getEquation(DB&A,DB&B,DB&C)const{A=a.y-b.y,B=b.x-a.x,C=det(a, b);}

    Line&push(DB r){ // 正数右手螺旋向里
        Po v=d()._1().lt()*r;a+=v,b+=v; rTs;
    }
};

inline DB dot(cLine l1,cLine l2){return dot(l1.d(),l2.d());}
inline DB dot(cLine l,cPo p){return dot(l.a,l.b,p);}
inline DB dot(cPo p,cLine l){return dot(p,l.a,l.b);}
inline DB det(cLine l1,cLine l2){return det(l1.d(),l2.d());}
inline DB det(cLine l,cPo p){return det(l.a,l.b,p);}
inline DB det(cPo p,cLine l){return det(p,l.a,l.b);}
inline DB ang(cLine l0,cLine l1){return ang(l0.d(),l1.d());}
inline DB ang(cLine l,cPo p){return ang(l.a,l.b,p);}
inline DB ang(cPo p,cLine l){return ang(p,l.a,l.b);}

inline int Line::sgn(cLine l)const{return dett(Ts, l);}
inline Po Line::operator*(cLine l)const{return a+d()*det(a,l)/det(Ts,l);}
inline Po operator&(cPo p,cLine l){return l*Line(p,p+l.d().lt());}
inline Po operator%(cPo p,cLine l){return p&l*2-p;}
inline Line push(Line l, DB r){return l.push(r);}

struct Seg: public Line{
    Seg(cPo a=Po(),cPo b=Po()):Line(a,b){}
    Seg(DB x0,DB y0,DB x1,DB y1):Line(x0,y0,x1,y1){}
    Seg(cLine l):Line(l){}
    Seg(const Po &a,DB alpha):Line(a,alpha){}
    Seg(DB A,DB B,DB C):Line(A,B,C){}

    inline int sgn(cPo p)const;
    inline int sgn(cLine l)const;
    inline bool qrt(cSeg l)const;
    inline int sgn(cSeg l)const;
};

 // -1不相交 0相交（不规范） 1相交（规范）

inline int Seg::sgn(cPo p)const{return -dott(p,a,b);}
inline int Seg::sgn(cLine l)const{return sgn(Ts*l);}

// quick_rejection_test
inline bool Seg::qrt(cSeg l)const{
    return min(a.x,b.x)<=max(l.a.x,l.b.x)&&min(l.a.x,l.b.x)<=max(a.x,b.x)&&
        min(a.y,b.y)<=max(l.a.y,l.b.y)&&min(l.a.y,l.b.y)<=max(a.y,b.y);
}

inline int Seg::sgn(cSeg l)const{
    if (!qrt(l)) return -1;

    /*return
        (dett(a,b,l.a)*dett(a,b,l.b)<=0 &&
        dett(l.a,l.b,a)*dett(l.a,l.b,b)<=0)?1:-1;*/

    int d1=dett(a,b,l.a),d2=dett(a,b,l.b),d3=dett(l.a,l.b,a),d4=dett(l.a,l.b,b);
    if ((d1^d2)==-2&&(d3^d4)==-2)return 1;
    return ((!d1&&dott(l.a-a,l.a-b)<=0)||(!d2&&dott(l.b-a,l.b-b)<=0)||
            (!d3&&dott(a-l.a,a-l.b)<=0)||(!d4&&dott(b-l.a,b-l.b)<=0))?0:-1;
}

//inline DB dist2(cLine l,cPo p){return sqr(fabs(dot(lt(l.d()), p-l.a)))/l.len2();}
inline DB dist2(cLine l,cPo p){return sqr(fabs(det(l.d(), p-l.a)))/l.len2();}

inline DB dist2(cLine l1,cLine l2){return dett(l1,l2)?0:dist2(l1,l2.a);}

inline DB dist2(cSeg l,cPo p){
    Po pa = p - l.a, pb = p - l.b;
    if (dott(l.d(), pa) <= 0) return pa.len2();
    if (dott(l.d(), pb) >= 0) return pb.len2();
    return dist2(Line(l), p);
}

inline DB dist2(cSeg s,cLine l){
    Po v1=s.a-l.a,v2=s.b-l.a;DB d1=det(l.d(),v1),d2=det(l.d(),v2);
    return sgn(d1)!=sgn(d2) ? 0 : sqr(min(fabs(d1), fabs(d2)))/l.len2();
}
inline DB dist2(cSeg l1,cSeg l2){
    if (~l1.sgn(l2)) return 0;
    else return min(dist2(l2,l1.a), dist2(l2,l1.b), dist2(l1,l2.a), dist2(l1,l2.b));
}
template<class T1, class T2> inline DB dist2(const T1& a, const T2& b){
    return dist2(b, a);
}

} using namespace CG;//}
//}

/** I/O Accelerator Interface .. **/ //{
#define g (c=getchar())
#define d isdigit(g)
#define p x=x*10+c-'0'
#define n x=x*10+'0'-c
#define pp l/=10,p
#define nn l/=10,n
template<class T> inline T& RD(T &x){
    char c;while(!d);x=c-'0';while(d)p;
    return x;
}
template<class T> inline T& RDD(T &x){
    char c;while(g,c!='-'&&!isdigit(c));
    if (c=='-'){x='0'-g;while(d)n;}
    else{x=c-'0';while(d)p;}
    return x;
}
inline DB& RF(DB &x){
    //scanf("%lf", &x);
    char c;while(g,c!='-'&&c!='.'&&!isdigit(c));
    if(c=='-')if(g=='.'){x=0;DB l=1;while(d)nn;x*=l;}
        else{x='0'-c;while(d)n;if(c=='.'){DB l=1;while(d)nn;x*=l;}}
    else if(c=='.'){x=0;DB l=1;while(d)pp;x*=l;}
        else{x=c-'0';while(d)p;if(c=='.'){DB l=1;while(d)pp;x*=l;}}
    return x;
}
#undef nn
#undef pp
#undef n
#undef p
#undef d
#undef g
inline char* RS(char *s){
    //gets(s);
    scanf("%s", s);
    return s;
}

LL last_ans; int Case; template<class T> inline void OT(const T &x){
    //printf("Case #%d: ", ++Case);
    //printf("%lld\n", x);
    printf("%.9f\n", x);
    //printf("%d\n", x);
    //cout << x << endl;
    //last_ans = x;
}
//}

//}/* .................................................................................................................................. */

const int N = 2009;

DB dp[N][N]; bool row[N], col[N];
int n, r, c;

int main(){

#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
#endif

    r = c = RD(n); Rush row[RD()-1] = col[RD()-1] = 1;
    REP(i, n) r -= row[i], c -= col[i];
    REP_1(i, n) dp[0][i] = dp[i][0] = dp[i-1][0] + ((DB)n/i);
    REP_2_1(i, j, n, n) dp[i][j] = (dp[i-1][j-1]*i*j + dp[i-1][j]*i*(n-j) + dp[i][j-1]*j*(n-i) + n*n) / (n*(i+j)-i*j);
    OT(dp[r][c]);
}

    // p = i/n

    /*x = (i*y + (n-i*(x)) + n
    x = (py+(1-p)x) + 1;
    px = py + 1
    x = y + 1/p*/


#include <bits/stdc++.h>
using namespace std;

double f[2222][2222];
int visited[2222][2222], n;
set <int> rows, columns;

double dp(int rows, int cols)
{
	if (rows == n && cols == n) return 0;

	if (visited[rows][cols]) return f[rows][cols];
	visited[rows][cols] = 1;

	if (rows < n && cols < n) f[rows][cols] += (dp(rows + 1, cols + 1) + 1) * (n - rows) * (n - cols);
	if (cols < n) f[rows][cols] += (dp(rows, cols + 1) + 1) * rows * (n - cols);
	if (rows < n) f[rows][cols] += (dp(rows + 1, cols) + 1) * (n - rows) * cols;
	f[rows][cols] += rows * cols;
	f[rows][cols] /= (n * n - rows * cols);

	return f[rows][cols];
}

int main()
{
	int m, x, y;
	cin >> n >> m;
	while (m--)
	{
		cin >> x >> y;
		rows.insert(x);
		columns.insert(y);
	}

	printf("%.6lf\n", dp(rows.size(), columns.size()));
}


//ITNOG
#include<bits/stdc++.h>

using namespace std;

//#define int long long

const int maxN = 2000 + 5;
const int mod = 1000*1000*1000 + 7;

double dp[maxN][maxN];
int r[maxN], c[maxN];

main()
{
    ios::sync_with_stdio(0); cin.tie(0);
    int n, m; cin >> n >> m;

    for(int i = 0; i < m; i ++)
    {
	  int v, u; cin >> v >> u; v --; u --;
	  r[v] = 1; c[u] = 1;
    }

    int cnt1 = 0, cnt2 = 0;
    for(int i = 0; i < n; i ++)
	  cnt1 += r[i], cnt2 += c[i];

    for(int i = n; i >= cnt1; i --)
	  for(int j = n; j >= cnt2; j --)
	  {
		if(i == n && j == n) continue;

		dp[i][j] += double(j) * double(n - i) / double(n * n) * (dp[i + 1][j]);
		dp[i][j] += double(i) * double(n - j) / double(n * n) * (dp[i][j + 1]);
		dp[i][j] += double(n - i) * double(n - j) / double(n * n) * (dp[i + 1][j + 1]);

		dp[i][j] += 1;

		dp[i][j] *= double(n * n) / double(n * n - i * j);
	  }

    cout << fixed << setprecision(10) << dp[cnt1][cnt2] << endl;
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int MAXN = 2e3 + 10;

int n, m, a, b;
double dp[MAXN][MAXN];
bool row[MAXN], col[MAXN];

int main()
{
    int u, v;
    scanf("%d%d", &n, &m);
    a = b = n;
    while (m--)
    {
        scanf("%d%d", &u, &v);
        if (!row[u])
        {
            --a;
        }
        if (!col[v])
        {
            --b;
        }
        row[u] = col[v] = true;
    }
    for (int i = 1; i <= n; ++i)
    {
        dp[i][0] += dp[i - 1][0] + 1.0 * n / i;
        dp[0][i] += dp[0][i - 1] + 1.0 * n / i;
    }
    for (int i = 1; i <= a; ++i)
    {
        for (int j = 1; j <= b; ++j)
        {
            dp[i][j] = (n * n + i * j * dp[i - 1][j - 1] + (n - i) * j * dp[i][j - 1] + i * (n - j) * dp[i - 1][j]) / (n * n - (n - i) * (n - j));
        }
    }
    printf("%.10f\n", dp[a][b]);
    return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>

using namespace std;

void aux(double n, vector<vector<double>>& mem){
	for(double n1=0;n1<=n;++n1)
		for(double n2=0;n2<=n;++n2){
			if(n1 == 0 && n2 == 0) continue;
			double res = 1;
			double p1 = (n-n1)/n * (n-n2)/n;

			if(n1!=0 && n2!=n){
				double p2 = n1/n * (n-n2)/n;
				res += p2*(mem[n1-1][n2]);
			}

			if(n1!=n && n2!=0){
				double p3 = (n-n1)/n * n2/n;
				res += p3*(mem[n1][n2-1]);
			}

			if(n1!=0 && n2!=0){
				double p4 = n1/n * n2/n;
				res += p4*(mem[n1-1][n2-1]);
			}
			mem[n1][n2] = res/(1-p1);
		}
	}

int main(){
	int n, m;
	cin >> n >> m;
	set<int> h, v;
	for(int i=0;i<m;++i){
		int a,b;
		cin >> a >> b;
		h.insert(a);
		v.insert(b);
	}

	int n1 = n-h.size(), n2 = n-v.size();
	vector<vector<double> > mem(n+1, vector<double>(n+1, 0));

	aux(n, mem);

	cout << mem[n1][n2] << '\n';
}


#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string.h>
#include <bitset>
#include <set>
#include <map>
#include <stack>
#include <cstdio>
#include <sstream>
#include <limits.h>		//INT_MAX, SHRT_MAX, LLONG_MAX
#define REP(i,n)  for(int i=0;i<(int)(n);++i)
#define FOR(i,b,n)  for(int i=b;i<(n);++i)
#define ALL(c) (c).begin(),(c).end()
#define SZ(c) (int)((c).size())
#define CLR(a,v) memset((a),(v), sizeof a)
#define PB push_back
#define MP make_pair
#define ST first
#define ND second
using namespace std;
#pragma GCC diagnostic ignored "-Wformat"   // "%I64d"
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int,int> pii;
typedef vector<pii> vpii;
typedef vector<string> vs;
typedef set<int> si;

template <typename T> void printContainer(T& a) {
  auto it = a.begin();
  cout << "{" << *(it++);
  for(; it!=a.end(); ++it) cout << ", " << (*it);
  cout << "}\n";
}

int main() {
	int n, m; cin >> n >> m;
	si rows, cols;
	REP(i,m) {
		int r, c;
		cin >> r >> c;
		rows.insert(r); cols.insert(c);
	}
	int seek_row = rows.size();
	int seek_col = cols.size();
	vd row[2]; REP(i,2) row[i].resize(n+1);
	int r = n;
	row[r%2][n] = 0;
	for(int c=n-1;c>=0;--c) {
		double a = (double)c/n;
		row[r%2][c] = (1 + (double)(n - c)/n * row[r%2][c+1]) / (1 - a);
	}
	if (r==seek_row) {
		printf("%f\n", row[r%2][seek_col]);
		return 0;
	}
	for(--r;r>=0;--r) {
		for(int c=n; c>=0; --c) {
			double a = (double)c/n * (double)r/n;
			row[r%2][c] =  1 + (double)(n-r)/n * (double) c/n * row[(r+1)%2][c];
			if (c!=n) {
				row[r%2][c] +=  (double)(n-r)/n * (double) (n-c)/n * row[(r+1)%2][c+1];
				row[r%2][c] +=  (double)r/n * (double) (n-c)/n * row[r%2][c+1];
			}
			row[r%2][c] *= 1./(1-a);
		}
		if (r==seek_row) {
			printf("%f\n", row[r%2][seek_col]);
			return 0;
		}
	}
}


#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string.h>
#include <bitset>
#include <set>
#include <map>
#include <stack>
#include <cstdio>
#include <sstream>
#include <limits.h>		//INT_MAX, SHRT_MAX, LLONG_MAX
#define REP(i,n)  for(int i=0;i<(int)(n);++i)
#define FOR(i,b,n)  for(int i=b;i<(n);++i)
#define ALL(c) (c).begin(),(c).end()
#define SZ(c) (int)((c).size())
#define CLR(a,v) memset((a),(v), sizeof a)
#define PB push_back
#define MP make_pair
#define ST first
#define ND second
using namespace std;
#pragma GCC diagnostic ignored "-Wformat"   // "%I64d"
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int,int> pii;
typedef vector<pii> vpii;
typedef vector<string> vs;
typedef set<int> si;

template <typename T> void printContainer(T& a) {
  auto it = a.begin();
  cout << "{" << *(it++);
  for(; it!=a.end(); ++it) cout << ", " << (*it);
  cout << "}\n";
}

int main() {
	int n, m; scanf("%d%d",&n,&m);
	si rows, cols;
	REP(i,m) {
		int r, c;
		scanf("%d%d",&r,&c);
		rows.insert(r); cols.insert(c);
	}
	int seek_row = rows.size();
	int seek_col = cols.size();
	vd row[2]; REP(i,2) row[i].resize(n+1);
	int r = n;
	row[r%2][n] = 0;
	for(int c=n-1;c>=0;--c) {
		double a = (double)c/n;
		row[r%2][c] = (1 + (double)(n - c)/n * row[r%2][c+1]) / (1 - a);
	}
	if (r==seek_row) {
		printf("%f\n", row[r%2][seek_col]);
		return 0;
	}
	for(--r;r>=0;--r) {
		for(int c=n; c>=0; --c) {
			double a = (double)c/n * (double)r/n;
			row[r%2][c] =  1 + (double)(n-r)/n * (double) c/n * row[(r+1)%2][c];
			if (c!=n) {
				row[r%2][c] +=  (double)(n-r)/n * (double) (n-c)/n * row[(r+1)%2][c+1];
				row[r%2][c] +=  (double)r/n * (double) (n-c)/n * row[r%2][c+1];
			}
			row[r%2][c] *= 1./(1-a);
		}
		if (r==seek_row) {
			printf("%f\n", row[r%2][seek_col]);
			return 0;
		}
	}
}


/*
    Author: Zhouxing Shi
    Created on Dec30, 2014
*/
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define drep(i, a, b) for (int i = (a); i >= (b); --i)
#define REP(i, a, b) for (int i = (a); i < (b); ++i)
#define pb(x) push_back(x)
#define mp(x, y) (make_pair(x, y))
#define clr(x) memset(x, 0, sizeof(x))
#define xx first
#define yy second

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
const int inf = ~0U >> 1;
const ll INF = ~0ULL >> 1;
template <class T> inline void read(T &n)
{
    char c;
    for (c = getchar(); !(c >= '0' && c <= '9'); c = getchar()); n = c - '0';
    for (c = getchar(); c >= '0' && c <= '9'; c = getchar()) n = n * 10 + c - '0';
}
int Pow(int base, int n, int mo)
{
    if (n == 0) return 1;
    if (n == 1) return base % mo;
    int tmp = Pow(base, n >> 1, mo);
    tmp = (ll)tmp * tmp % mo;
    if (n & 1) tmp = (ll)tmp * base % mo;
    return tmp;
}
//***************************

int n, m, x, y, cr[3000], cc[3000], cntr, cntc;
double dp[3000][3000];

int main()
{
	scanf("%d%d", &n, &m);
	rep(i, 1, m) scanf("%d%d", &x, &y), cr[x]++, cc[y]++;
	rep(i, 1, n)
	{
		if (!cr[i]) cntr++;
		if (!cc[i]) cntc++;
	}
	dp[0][0] = 0;
	rep(i, 0, cntr)
		rep(j, 0, cntc)
		{
			if (!i && !j) continue;
			double p1 = 1. * i * j / n / n;
			double p2 = 1. * i * (n - j) / n / n;
			double p3 = 1. * (n - i) * j / n / n;
			double p4 = 1. * (n - i) * (n - j) / n / n;
			double tmp = 0;
			if (i - 1 >= 0 && j - 1 >= 0)
				tmp += p1 * (dp[i - 1][j - 1] + 1);
			if (i - 1 >= 0)
				tmp += p2 * (dp[i - 1][j] + 1);
			if (j - 1 >= 0)
				tmp += p3 * (dp[i][j - 1] + 1);
			dp[i][j] = (tmp + p4) / (1. - p4);
		}
	printf("%.10lf\n", dp[cntr][cntc]);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <queue>
#include <set>
#include <cstdlib>
#include <cassert>
#include <cmath>
#include <map>
#include <cctype>

#define DEBUG 0

#if (DEBUG == 1)
    #define debug(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
#else
    #define debug(fmt, ...)
#endif

#define INFTY 2000000000
#define INFTYLL 4000000000000000000LL
using namespace std;

typedef pair<int,int> pint;
typedef long long int lint;

/* FAST IO ********************** */
int nextchar() {
    static const int BUFSIZE = 1<<20;
    static char buf[BUFSIZE], *ptr = buf+BUFSIZE;
    if (ptr == buf+BUFSIZE) {
        fread(buf, 1, BUFSIZE, stdin);
        ptr = buf;
    }
    return *ptr++;
}
int nextint() {
    char c;
    while (!isdigit(c = nextchar()) && c != '-') ;
    int ans = c=='-' ? 0 : c-'0',
        sign = c == '-' ? -1 : 1;
    while (isdigit(c = nextchar())) ans = ans * 10 + c-'0';
    ans *= sign;
    // printf("READ %d\n", ans);
    return ans;
}
/* ****************************** */

const int MAXN = 2000;
double dp[MAXN+1][MAXN+1];

int main()
{
    ios_base::sync_with_stdio(false);

    int N, p;
    scanf("%d %d", &N, &p);
    vector<bool> rows(N, false), cols(N, false);
    int rempt = N, cempt = N;
    while (p--) {
        int r, c;
        scanf("%d %d", &r, &c); r--; c--;
        if (!rows[r]) rempt --;
        rows[r] = true;

        if (!cols[c]) cempt --;
        cols[c] = true;
    }

    debug("N=%d, R=%d, C=%d\n", N, rempt, cempt);

    dp[0][0] = 0.0; // nothing to do here
    for (int r=0; r<=rempt; r++) {
        for (int c=0; c<=cempt; c++) {
            if (r+c == 0) continue;
            double pC = (1.0 - 1.0*c/N) * (1.0 - 1.0*r/N);
            double pA = (1.0*r/N) * (1.0 - 1.0*c/N);
            double pB = (1.0 - 1.0*r/N) * (1.0*c/N);
            double pD = (1.0*r/N) * (1.0*c/N);

            assert(fabs(pA+pB+pC+pD-1.0) < 0.000001);

            dp[r][c] =
                (r ? pA * (1.0+dp[r-1][c]) : 0.0) +
                (c ? pB * (1.0+dp[r][c-1]) : 0.0) +
                (r && c ? pD * (1.0+dp[r-1][c-1]) : 0.0) +
                pC;

            dp[r][c] /= (1.0 - pC);

            debug("%d %d, dp = %.3f, p=%.3f, %.3f, %.3f, %.3f\n", r, c, dp[r][c], pA, pB, pC, pD);
        }
    }

    printf("%.6f\n", dp[rempt][cempt]);

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <set>

#define MAX 2048

using namespace std;

double dp[MAX][MAX];
bool vis[MAX][MAX];
set<int> st[2];

double dfs(int n, int x, int y) {
    double p = (double)x / (double)n, q = (double)y / (double)n, sum = 1.0;

    if (!x && !y) return 0;
    if (vis[x][y]) return dp[x][y];
    vis[x][y] = true;
    if (x && y) sum += p * q * dfs(n, x - 1, y - 1);
    if (x) sum += p * (1 - q) * dfs(n, x - 1, y);
    if (y) sum += (1 - p) * q * dfs(n, x, y - 1);

    return dp[x][y] = sum / (1 - (1 - p) * (1 - q));
}

int main() {
    int n, m, x, y, i;

    while (~scanf("%d%d", &n, &m)) {
        st[0].clear(); st[1].clear();
        for (i = 0; i < m; ++i) {
            scanf("%d%d", &x, &y);
            st[0].insert(x); st[1].insert(y);
        }
        memset(vis, 0, sizeof(vis));
        printf("%f\n", dfs(n, n - st[0].size(), n - st[1].size()));
    }

    return 0;
}


#include <iostream>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef long double ld;

const int N = 3000 + 5;
ld dp[N][N];
int mX[N], mY[N];

int main() {
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(4);
	int n;
	cin >> n;
	for(int i = n;i > -1;--i) {
		for(int j = n;j > -1;--j) {
			if(i == n && j == n)
				continue;
			dp[i][j] = (i * (n - j)) * (1 + dp[i][j + 1]) + (j * (n - i)) * (1 + dp[i + 1][j]) + ((n - i) * (n - j)) * (1 + dp[i + 1][j + 1]);
			dp[i][j] += i * j;
			dp[i][j] /= (ld)(n * n - i * j);
		}
	}
	///
	int m, a, b, r = 0, l = 0;
	cin >> m;
	for(int i = 0;i < m;++i) {
		cin >> a >> b;
		if(!mX[a]++)
			++r;
		if(!mY[b]++)
			++l;
	}
	cout << dp[r][l] << endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <memory.h>

using namespace std;

bool w1[2002], w2[2002];
long double dp1[2][2002];
long double dp2[2][2002];

int main() {
  int n, m, x, y;
  scanf("%d%d", &n, &m);
  int r = n, c = n;
  for (int i = 0; i < m; ++i) {
    scanf("%d%d", &x, &y); --x; --y;
    if (!w1[x]) {
      w1[x] = true;
      --r;
    }
    if (!w2[y]) {
      w2[y] = true;
      --c;
    }
  }
  // cout << r << "  " << c << endl;
  long double ans = 0;
  int N = max(r, c);
  dp1[0][0] = 1.0;
  dp2[0][0] = 1.0;
  int cur = 0, nx = 1;
  for (int st = 0; st < 100000; ++st) {
    for (int k = 0; k <= r; ++k) {
      if (dp1[cur][k] > 1e-20) {
        dp1[nx][k] += 1.0 * (n - (r - k)) / n * dp1[cur][k];
        if (k + 1 <= r)
          dp1[nx][k + 1] += 1.0 * (r - k) / n * dp1[cur][k];
      }
    }
    for (int k = 0; k <= c; ++k) {
      if (dp2[cur][k] > 1e-20) {
        dp2[nx][k] += 1.0 * (n - (c - k)) / n * dp2[cur][k];
        if (k + 1 <= c)
          dp2[nx][k + 1] += 1.0 * (c - k) / n * dp2[cur][k];
      }
    }
    // cout << st << " " << dp1[st][r] << "  " << dp2[st][c] << endl;
    ans += (st + 1) * ((dp1[nx][r]) * (dp2[nx][c]) - dp1[cur][r] * dp2[cur][c]);
    cur ^= 1; nx ^= 1;
    memset(dp1[nx], 0, sizeof(dp1[nx]));
    memset(dp2[nx], 0, sizeof(dp2[nx]));
  }
  printf("%.5lf\n", (double)ans);
  return 0;
}


#include <iostream>
#include <cmath>
#include <iomanip>
#include <cstring>
using namespace std;

typedef double flt;
const int MX=2*1000+9;
flt dp[MX][MX];
int n, m;

void fill_dp(void)
{
    dp[0][0]=0.0;
    for(int i=1; i<=n; i++) dp[0][i]=dp[0][i-1]+(n*1.0)/i;
    for(int i=1; i<=n; i++)
    {
        dp[i][0]=dp[0][i];
        for(int j=1; j<=n; j++)
        {
            double coeff=(n*n-(n-i)*(n-j)+0.0)/(n*n);
            double RHS=1.0+(i*j*dp[i-1][j-1]+(n-i)*j*dp[i][j-1]+i*(n-j)*dp[i-1][j])/(n*n);
            dp[i][j]=RHS/coeff;
        }
    }
}

bool free_row[MX];
bool free_col[MX];

int main()
{
    cin >> n >> m;
    fill_dp();

    memset(free_row, true, (n+1)*sizeof(bool));
    memset(free_col, true, (n+1)*sizeof(bool));

    int r, c;
    for(int i=0; i<m; i++)
    {
        cin >> r >> c;
        free_row[r]=false;
        free_col[c]=false;
    }

    int rows=0;
    for(int i=1; i<=n; i++) rows+=free_row[i];
    int cols=0;
    for(int i=1; i<=n; i++) cols+=free_col[i];
    //cout << rows << ' ' << cols << endl;
    cout << setprecision(10);
    cout << dp[rows][cols];

    /*
    cout << '\n';
    for(int i=0; i<=n; i++)
    {
        for(int j=0; j<=n; j++) cout << dp[i][j] << ' ';
        cout << '\n';
    }
    */
    return 0;
}


#include <iostream>

using namespace std;

int N, M;
double Table[2005][2005];
int R, C;
bool chkR[2005], chkC[2005];

int main()
{
    ios::sync_with_stdio(0);
    cin >> N >> M;
    R = C = N;

    for (int i = 1; i <= M; i++)
    {
        int r, c;
        cin >> r >> c;

        if (!chkR[r])
            --R;
        if (!chkC[c])
            --C;
        chkR[r] = chkC[c] = true;
	}

	for (int i = 1; i <= N; i++)
        Table[i][0] = Table[i - 1][0] + double(N) / i;

	for (int j = 1; j <= N; j++)
        Table[0][j] = Table[0][j - 1] + double(N) / j;

	for (int i = 1; i <= N; i++)
    {
        for (int j = 1; j <= N; j++)
        {
            double & v = Table[i][j];
            v = (i * j * Table[i - 1][j - 1]) + ((N - i) * j * Table[i][j - 1]) + (i * (N - j) * Table[i - 1][j]);
            v /= N * N;
            v += 1;
            v /= (1.0 - double(N - i) * (N - j) / (N * N));
        }
    }
    cout << Table[R][C] << '\n';
	return 0;
}


#include <vector>
#include <iostream>
#include <set>
#include <cstdio>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <tuple>
#include <algorithm>
#include <limits>
#include <cstring>
#include <cmath>

using namespace std;
typedef long long ll;
const int MN = 2010;
double dp[MN][MN];
bool used[MN][MN] = {};
int n;
double solve(int x, int y) {
    if (x < 0 || y < 0) return 0;
    if (!x && !y) return 0;
    if (used[x][y]) return dp[x][y];
    double xc = x*(n-y), yc = (n-x)*y, xyc = x*y, c = (n-x)*(n-y);
    xc /= n*n-c; yc /= n*n-c; xyc /= n*n-c; c /= n*n;
    double res = 1/(1-c);
    res += xc*solve(x-1, y);
    res += yc*solve(x, y-1);
    res += xyc*solve(x-1, y-1);
    used[x][y] = true;
    dp[x][y] = res;
    return res;
}
int main() {
    int m;
    cin >> n >> m;
    bool x[MN] = {}, y[MN] = {};
    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b; a--; b--;
        x[a] = true; y[b] = true;
    }
    int xc, yc;
    xc = count(x, x+n, false);
    yc = count(y, y+n, false);
    printf("%.20f\n", solve(xc, yc));
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <limits>
#include <cstring>
#include <string>
using namespace std;

#define pairii pair<int, int>
#define llong long long
#define pb push_back
#define sortall(x) sort((x).begin(), (x).end())
#define INFI  numeric_limits<int>::max()
#define INFL  numeric_limits<long>::max()
#define INFLL numeric_limits<llong>::max()
#define INFD  numeric_limits<double>::max()
#define MOD 1000000007
#define PI 3.1415926535897932384626433832795028841971693993751058209749445923
#define FOR(i,s,n) for (int (i) = (s); (i) < (n); (i)++)
#define FORZ(i,n) FOR((i),0,(n))

//#define TESTFILE

double dp[2001][2001];
bool row[2001] = {};
bool col[2001] = {};

int main() {
#ifdef TESTFILE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    int m,n;
    cin >> n >> m;

    FORZ(i,m) {
        int r, c;
        cin >> r >> c;
        row[r] = true;
        col[c] = true;
    }

    int cntr = 0;
    int cntc = 0;
    FOR(i,1,n+1) {
        if (!row[i]) cntr++;
        if (!col[i]) cntc++;
    }

    dp[0][0] = 0.0;
    FOR(i,1,cntr+1) dp[i][0] = (double)n/(double)i + dp[i-1][0];
    FOR(i,1,cntc+1) dp[0][i] = (double)n/(double)i + dp[0][i-1];

    FOR(i,1,cntr+1) {
        FOR(j, 1, cntc+1) {
            double denom = n*(i+j)-i*j;
            dp[i][j] = (double)(i*(n-j))/denom * dp[i-1][j] + (double)(j*(n-i))/denom * dp[i][j-1] + (double)(i*j)/denom * dp[i-1][j-1];
            dp[i][j] += (double)(n*n) / denom;
        }
    }

    printf("%1.10f\n", dp[cntr][cntc]);

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

// Template
#define mp(a, b) make_pair(a, b)
#define pb(x) push_back(x)
#define ALL(X) X.begin(), X.end()
#define SORT(x) sort(ALL(x))
#define next ___next
#define hash ___hash
#define rank ___rank
#define get _____get
#define count __count
#ifdef _DEBUG_
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...)
#endif
#if((_WIN32 || __WIN32__) && __cplusplus < 201103L)
    #define LLD "%I64d"
#else
    #define LLD "%lld"
#endif

const double EPS = 1e-9;
const int IINF = 1000000000;
const double PI = acos(-1.0);
const long long LINF = 6000000000000000000LL;

// End of template

const int maxN = 2 * 1000 + 7;

int n, m;
double f[maxN][maxN];
int c[maxN], r[maxN];

void cleanup() {
    for(int i = 0; i < maxN; ++i) {
        r[i] = c[i] = 0;
        for(int j = 0; j < maxN; ++j) {
            f[i][j] = 0.0;
        }
    }
}

bool Read() {
    cleanup();
    if(scanf("%d%d", &n, &m) == 2) {
        int R, C;
        for(int i = 0; i < m; ++i) {
            scanf("%d%d", &R, &C);
            r[R - 1]++, c[C - 1]++;
        }
        return true;
    }
    return false;
}

void Run() {
    int I(0), J(0);
    for(int i = 0; i < n; ++i) {
        if(r[i] == 0) ++I;
        if(c[i] == 0) ++J;
    }
    f[0][0] = 0.0;
    for(int i = 1; i <= I; ++i) {
        f[i][0] = (n + .0) / (i + .0) + f[i - 1][0];
    }
    for(int j = 1; j <= J; ++j) {
        f[0][j] = (n + .0) / (j + .0) + f[0][j - 1];
    }
    for(int i = 1; i <= I; ++i) {
        for(int j = 1; j <= J; ++j) {
            f[i][j] = 1.0 + (f[i - 1][j - 1] * i * j + f[i - 1][j] * i * (n - j) + f[i][j - 1] * j * (n - i)) / (n * 1.0 * n);
            double w = 1.0 - ((n - i - .0) * (n - j - .0)) / (n * 1.0 * n);
            f[i][j] /= w;
        }
    }
    printf("%.13lf\n", f[I][J]);
}

int main() {
#ifdef _DEBUG_
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    while(Read()) {
        Run();
    }

    return 0;
}


#include <bits/stdc++.h>

#define llong long long

using namespace std;

const int INF = (int) 1e9;
const int MXN = (int) 2e3 + 7;

int n, m;
double dp[MXN][MXN];
bool c[MXN][MXN];

bool ucol[MXN], urow[MXN];

double calc(int x, int y) {
    if (c[x][y])
        return dp[x][y];

    c[x][y] = true;
    if (!x && !y) dp[x][y] = 0;
    else if (!x) dp[x][y] = calc(x, y - 1) + 1.0 * n / (double)y;
    else if (!y) dp[x][y] = calc(x - 1, y) + 1.0 * n / (double)x;
    else {
        dp[x][y] = ((x * y * calc(x - 1, y - 1)) + ((n - x) * y * calc(x, y - 1)) + (x * (n - y) * calc(x - 1, y))) / (1.0 * n * n);
        dp[x][y] = dp[x][y] + 1;
        dp[x][y] /= (1.0 - (double) (n - x) * (n - y) / (n * n));
    }
    return dp[x][y];
}
int main() {
    scanf("%d%d", &n, &m);
    while (m--) {
        int x, y;
        scanf("%d%d", &x, &y);
        ucol[x] = urow[y] = true;
    }
    int N = n, M = n;
    for (int i = 1; i <= n; i++)
        if (ucol[i]) N--;
    for (int i = 1; i <= n; i++)
        if (urow[i]) M--;

    //cout << dp[1][0] << endl;
    cout << fixed << setprecision(5) << calc(N, M);
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <iomanip>
using namespace std;
double n;
int m;
int x, y;
bool lx[2003], ly[2003];
double dp[2003][2003];
bool vis[2003][2003];
double dfs(int x, int y) {
    if(x == n && y == n) return 0;
    if(vis[x][y]) return dp[x][y];
    vis[x][y] = 1;
    double a = 0, b = 0, c = 0;
    if(x+1 <= n)a = (n-x)*y/(n*n)*dfs(x+1, y);
    if(y+1 <= n) b = x*(n-y)*1.0/(n*n)*dfs(x, y+1);
    if(x+1 <= n && y+1 <=n) c = (n-x)*(n-y)*1.0/(n*n)*dfs(x+1, y+1);
    return dp[x][y] = (a+b+c+1.0)/(1.0-x*y/(n*n));
}
int main() {
    scanf("%lf%d", &n, &m);
    while(m--) {
        int a, b;
        scanf("%d%d", &a, &b);
        if(!lx[a]) {
            lx[a] = 1;
            x++;
        }
        if(!ly[b]) {
            ly[b] = 1;
            y++;
        }
    }
    printf("%.6f\n", dfs(x, y));
    return 0;
}


#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>

#include <iostream>
#include <iomanip>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>

using namespace std;

typedef long long int64;

const int oo = 0x3f3f3f3f;
const int MAX_N = 2005;

int N, R, C;
double DP[MAX_N][MAX_N];

void Solve() {
    for (int r = 0; r <= N; ++r) {
        for (int c = 0; c <= N; ++c) {
            if (r == 0 && c == 0) {
                DP[r][c] = 0.0;
                continue;
            }
            double coefficient = N * N - (N - r) * (N - c);
            DP[r][c] = (N - r) * (N - c);
            if (r > 0)
                DP[r][c] += r * (N - c) * (DP[r - 1][c] + 1);
            if (c > 0)
                DP[r][c] += (N - r) * c * (DP[r][c - 1] + 1);
            if (r > 0 && c > 0)
                DP[r][c] += r * c * (DP[r - 1][c - 1] + 1);
            DP[r][c] /= coefficient;
        }
    }
}

void Read() {
    int M;
    cin >> N >> M;
    R = C = N;
    vector<bool> solvedR = vector<bool>(N, false), solvedC = vector<bool>(N, false);
    for (; M > 0; --M) {
        int r, c;
        cin >> r >> c;
        --r;
        --c;
        if (!solvedR[r])
            --R;
        if (!solvedC[c])
            --C;
        solvedR[r] = solvedC[c] = true;
    }
}

void Print() {
    cout << fixed << setprecision(8) << DP[R][C] << "\n";
}

int main() {
    #ifndef ONLINE_JUDGE
        assert(freopen("b.in", "r", stdin));
        assert(freopen("b.out", "w", stdout));
    #endif
    Read();
    Solve();
    Print();
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <ctime>
#include <bitset>
#include <algorithm>
#include <set>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#define dou double
#define mem(a) memset(a, 0, sizeof(a))
#define memm(a) memset(a, -1, sizeof(a))
#define LL long long
#define PB push_back
#define MP make_pair
#define PII pair<int, int>
#define FI first
#define SE second
#define SZ(a) ((int) a.size())
#define ALL(a) a.begin(), a.end()
#define RI(a) scanf("%d", &(a))
#define RII(a, b) scanf("%d%d", &(a), &(b))
#define RIII(a, b, c) scanf("%d%d%d", &(a), &(b), &(c))
#define RL(a) scanf("%I64d", &(a))
#define RLL(a, b) scanf("%I64d%I64d", &(a), &(b))
#define RLLL(a, b, c) scanf("%I64d%I64d%I64d", &(a), &(b), &(c))
#define PI(r) printf("%d\n", (r))
#define PL(r) printf("%I64d\n", (r))
#define RS(s) scanf("%s", (s))
#define SL(a) strlen(a)
#define REP(i, n) for (int i = 0; i < (int) (n); ++i)
#define REPP(i, a, b) for (int i = (int) (a); i <= (int) (b); ++i)
#define FOR(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
#define MID ((l + r) >> 1)
#define L (x << 1)
#define R ((x << 1) | 1)
#define LC L, l, MID
#define RC R, MID + 1, r
#define LB(x) ((x) & (-(x)))
#pragma warning (disable : 4996)
//#pragma comment(linker, "/STACK:102400000,102400000")
#define EPS 1e-8
#define INF 2000000000
#define LIM (1ll << 60)
#define MOD 1000000007
#define N 2111

using namespace std;

int n, m;
dou dp[N][N];
bool x[N], y[N];

int main(){
	int t, a, b, z, ca = 1;
	// freopen("D:/Contest/1.in", "r", stdin);
	//freopen("1.ans", "w", stdout);
	//ios :: sync_with_stdio(false);
	RII(n, m);
	int r = 0, c = 0;
	REPP(i, 1, m) {
		RII(a, b);
		if (!x[a]) x[a] = 1, r++;
		if (!y[b]) y[b] = 1, c++;
	}
	//cout << r << ' ' << c << endl;
	dp[n][n] = 0.0;
	for (int i = n - 1; i >= 1; --i) dp[n][i] = 1.0 * n / (n - i) + dp[n][i + 1];
	for (int i = n - 1; i >= 1; --i) dp[i][n] = 1.0 * n / (n - i) + dp[i + 1][n];
	for (int i = n - 1; i >= 0; --i)
		for (int j = n - 1; j >= 0; --j) {
			dp[i][j] = 1.0 * (n * n) / (n * n - i * j) + (dp[i + 1][j] * (n - i) * j + dp[i][j + 1] * i * (n - j) + dp[i + 1][j + 1] * (n - i) * (n - j)) / (n * n - i * j);
		}
	printf("%.7lf\n", dp[r][c]);

	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <ctime>
#include <bitset>
#include <algorithm>
#include <set>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#define dou double
#define mem(a) memset(a, 0, sizeof(a))
#define memm(a) memset(a, -1, sizeof(a))
#define LL long long
#define PB push_back
#define MP make_pair
#define PII pair<int, int>
#define FI first
#define SE second
#define SZ(a) ((int) a.size())
#define ALL(a) a.begin(), a.end()
#define RI(a) scanf("%d", &(a))
#define RII(a, b) scanf("%d%d", &(a), &(b))
#define RIII(a, b, c) scanf("%d%d%d", &(a), &(b), &(c))
#define RL(a) scanf("%I64d", &(a))
#define RLL(a, b) scanf("%I64d%I64d", &(a), &(b))
#define RLLL(a, b, c) scanf("%I64d%I64d%I64d", &(a), &(b), &(c))
#define PI(r) printf("%d\n", (r))
#define PL(r) printf("%I64d\n", (r))
#define RS(s) scanf("%s", (s))
#define SL(a) strlen(a)
#define REP(i, n) for (int i = 0; i < (int) (n); ++i)
#define REPP(i, a, b) for (int i = (int) (a); i <= (int) (b); ++i)
#define FOR(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
#define MID ((l + r) >> 1)
#define L (x << 1)
#define R ((x << 1) | 1)
#define LC L, l, MID
#define RC R, MID + 1, r
#define LB(x) ((x) & (-(x)))
#pragma warning (disable : 4996)
//#pragma comment(linker, "/STACK:102400000,102400000")
#define EPS 1e-8
#define INF 2000000000
#define LIM (1ll << 60)
#define MOD 1000000007
#define N 2111

using namespace std;

int n, m;
dou dp[N][N];
bool x[N], y[N];

int main(){
	int t, a, b, z, ca = 1;
	// freopen("D:/Contest/1.in", "r", stdin);
	//freopen("1.ans", "w", stdout);
	//ios :: sync_with_stdio(false);
	RII(n, m);
	int r = 0, c = 0;
	REPP(i, 1, n) {
		RII(a, b);
		if (!x[a]) x[a] = 1, r++;
		if (!y[b]) y[b] = 1, c++;
	}
	//cout << r << ' ' << c << endl;
	dp[n][n] = 0.0;
	for (int i = n - 1; i >= 1; --i) dp[n][i] = 1.0 * n / (n - i) + dp[n][i + 1];
	for (int i = n - 1; i >= 1; --i) dp[i][n] = 1.0 * n / (n - i) + dp[i + 1][n];
	for (int i = n - 1; i >= 1; --i)
		for (int j = n - 1; j >= 1; --j) {
			dp[i][j] = 1.0 * (n * n) / (n * n - i * j) + (dp[i + 1][j] * (n - i) * j + dp[i][j + 1] * i * (n - j) + dp[i + 1][j + 1] * (n - i) * (n - j)) / (n * n - i * j);
		}
	printf("%.7lf\n", dp[r][c]);

	return 0;
}


#include <bits/stdc++.h>

#define LL long long
#define FI first
#define SE second
#define PB push_back
#define MP make_pair
#define VI vector<int>
#define VP vector<PII>
#define VS vector<string>
#define PII pair<int, int>
#define SZ(a) ((int) a.size())
#define ALL(a) a.begin(), a.end()
#define mem(a) memset(a, 0, sizeof(a))
#define memm(a) memset(a, -1, sizeof(a))

#define SL(a) strlen(a)
#define RS(s) scanf("%s", (s))
#define PI(r) printf("%d\n", (r))
#define RI(a) scanf("%d", &(a))
#define RII(a, b) scanf("%d%d", &(a), &(b))
#define RIII(a, b, c) scanf("%d%d%d", &(a), &(b), &(c))

#define DBG(x, s) cout << (x) << ' ' << (s) << endl
#define REP(i, n) for (int i = 0; i < (int) (n); ++i)
#define REPP(i, a, b) for (int i = (int) (a); i <= (int) (b); ++i)
#define RED(i, n) for (int i = (int) (n - 1); i >= 0; --i)
#define REDD(i, a, b) for (int i = (int) (a); i >= (int) (b); --i)

#define L (x << 1)
#define R ((x << 1) | 1)
#define MID ((l + r) >> 1)
#define LC L, l, MID
#define RC R, MID + 1, r
#define LB(x) ((x) & (-(x)))
#define B(x) __builtin_popcount(x)

#define EPS 1e-7
#define INF 0x3f3f3f3f
#define LIM (1ll << 60)

using namespace std;

int n, m;

const int N = 2005;
double dp[N][N];
bool vr[N], vc[N];

int main(){
	//freopen("cf.in", "r", stdin);
	//freopen("1.ans", "w", stdout);
	//ios :: sync_with_stdio(0);

	int t, x, y, z, ca = 1;

	RII(n, m);
	int r = 0, c = 0;
	REPP(i, 1, m) {
		RII(x, y);
		if (!vr[x]) vr[x] = 1, r++;
		if (!vc[y]) vc[y] = 1, c++;
	}

	dp[0][0] = 0.0;
	REPP(i, 1, n) dp[0][i] = dp[i][0] = 1.0 * n / i + dp[i - 1][0];
	REPP(i, 1, n) REPP(j, 1, n) {
		int tmp = (n * n - (n - i) * (n - j));
		dp[i][j] = 1.0 * n * n / tmp + 1.0 * i * (n - j) / tmp * dp[i - 1][j] + 1.0 * j * (n - i) / tmp * dp[i][j - 1] + 1.0 * i * j / tmp * dp[i - 1][j - 1];
	}
	printf("%.7f\n", dp[n - r][n - c]);

	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <ctime>
#include <bitset>
#include <algorithm>
#include <set>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#define dou double
#define mem(a) memset(a, 0, sizeof(a))
#define memm(a) memset(a, -1, sizeof(a))
#define LL long long
#define PB push_back
#define MP make_pair
#define PII pair<int, int>
#define FI first
#define SE second
#define SZ(a) ((int) a.size())
#define ALL(a) a.begin(), a.end()
#define RI(a) scanf("%d", &(a))
#define RII(a, b) scanf("%d%d", &(a), &(b))
#define RIII(a, b, c) scanf("%d%d%d", &(a), &(b), &(c))
#define RL(a) scanf("%I64d", &(a))
#define RLL(a, b) scanf("%I64d%I64d", &(a), &(b))
#define RLLL(a, b, c) scanf("%I64d%I64d%I64d", &(a), &(b), &(c))
#define PI(r) printf("%d\n", (r))
#define PL(r) printf("%I64d\n", (r))
#define RS(s) scanf("%s", (s))
#define SL(a) strlen(a)
#define REP(i, n) for (int i = 0; i < (int) (n); ++i)
#define REPP(i, a, b) for (int i = (int) (a); i <= (int) (b); ++i)
#define FOR(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
#define MID ((l + r) >> 1)
#define L (x << 1)
#define R ((x << 1) | 1)
#define LC L, l, MID
#define RC R, MID + 1, r
#define LB(x) ((x) & (-(x)))
#pragma warning (disable : 4996)
//#pragma comment(linker, "/STACK:102400000,102400000")
#define EPS 1e-8
#define INF 2000000000
#define LIM (1ll << 60)
#define MOD 1000000007
#define N 2111

using namespace std;

int n, m;
dou dp[N][N];
bool x[N], y[N];

int main(){
	int t, a, b, z, ca = 1;
	// freopen("D:/Contest/1.in", "r", stdin);
	//freopen("1.ans", "w", stdout);
	//ios :: sync_with_stdio(false);
	RII(n, m);
	int r = 0, c = 0;
	REPP(i, 1, m) {
		RII(a, b);
		if (!x[a]) x[a] = 1, r++;
		if (!y[b]) y[b] = 1, c++;
	}
	//cout << r << ' ' << c << endl;
	dp[n][n] = 0.0;
	for (int i = n - 1; i >= 1; --i) dp[n][i] = 1.0 * n / (n - i) + dp[n][i + 1];
	for (int i = n - 1; i >= 1; --i) dp[i][n] = 1.0 * n / (n - i) + dp[i + 1][n];
	for (int i = n - 1; i >= 1; --i)
		for (int j = n - 1; j >= 1; --j) {
			dp[i][j] = 1.0 * (n * n) / (n * n - i * j) + (dp[i + 1][j] * (n - i) * j + dp[i][j + 1] * i * (n - j) + dp[i + 1][j + 1] * (n - i) * (n - j)) / (n * n - i * j);
		}
	printf("%.7lf\n", dp[r][c]);

	return 0;
}


#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

#define f(i,a,b) for(int i = (a); i <= (int) (b); i++)
#define mp make_pair
#define pb push_back

typedef long long ll;
using namespace std;

bool U[2005];
double DP[2005][2005];
int N, M;

int main()
{
    cin >> N >> M;

    int a = N, b = N;

    while(M--)
    {
        int x, y;
        cin >> x >> y;

        if(!U[x])
            a--;
        if(!U[y])
            b--;

        U[x] = U[y] = true;
    }

    for(int i = 0; i <= a; i++)
        for(int j = 0; j <= b; j++)
        {
            if(i == 0 && j == 0)
                continue;

            double p = i, q = j, n = N;

            DP[i][j] = 1;
            if(i) DP[i][j] += DP[i-1][j] * (p/n) * ((n-q) / n);
            if(j) DP[i][j] += DP[i][j-1] * ((n-p) / n) * (q/n);
            if(i&&j) DP[i][j] += DP[i-1][j-1] * (p/n) * (q/n);
            if(i||j) DP[i][j] /= 1 - ((n-p) / n) * ((n-q) / n);
        }

    cout << DP[a][b];
}


#include<bits/stdc++.h>
#define REP(i,m) for(int i=0;i<(m);++i)
#define REPN(i,m,in) for(int i=(in);i<(m);++i)
#define ALL(t) (t).begin(),(t).end()
#define CLR(a) memset((a),0,sizeof(a))
#define pb push_back
#define mp make_pair
#define fr first
#define sc second

using namespace std;

#ifndef ONLINE_JUDGE
#define dump(x)  cerr << #x << " = " << (x) << endl
#define prl cerr<<"called:"<< __LINE__<<endl
template<class T> void debug(T a,T b){ for(;a!=b;++a) cerr<<*a<<' ';cerr<<endl;}
#else
#define dump(x) ;
#define prl ;
template<class T> void debug(T a,T b){ ;}
#endif

template<class T> void chmin(T& a,const T& b) { if(a>b) a=b; }
template<class T> void chmax(T& a,const T& b) { if(a<b) a=b; }
typedef long long int lint;
typedef pair<int,int> pi;

namespace std{
	template<class S,class T>
	ostream &operator <<(ostream& out,const pair<S,T>& a){
		out<<'('<<a.fr<<','<<a.sc<<')';
		return out;
	}
}
//const int INF=5e8;

double dp[2005][2005];
int n,m;
double prob[2005][2005];
int mark[2005][2005];
int main(){
	scanf("%d%d",&n,&m);
	REP(i,m){
		int a,b;scanf("%d%d",&a,&b);--a;--b;
		mark[a][b]=1;
	}

	int R=0,C=0;

	REP(i,n){
		int flag=0;
		REP(j,n) flag|=mark[i][j];
		if(flag) ++C;

		flag=0;
		REP(j,n) flag|=mark[j][i];
		if(flag) ++R;
	}

	dp[R][C]=0;
	prob[R][C]=1;
	for(int i=R;i<=n;++i) for(int j=C;j<=n;++j) {
		if(i==n && j==n) continue;
		double expTime=1.0*n*n/(n*n-i*j);
		dp[i+1][i+1]+=(dp[i][j]+expTime*prob[i][j])*(n-i)*(n-j)/(n*n-j*i);
		prob[i+1][j+1]+=prob[i][j]*(n-i)*(n-j)/(n*n-j*i);

		dp[i][j+1]+=(dp[i][j]+expTime*prob[i][j])*i*(n-j)/(n*n-j*i);
		prob[i][j+1]+=prob[i][j]*i*(n-j)/(n*n-j*i);

		dp[i+1][j]+=(dp[i][j]+expTime*prob[i][j])*(n-i)*j/(n*n-j*i);
		prob[i+1][j]+=prob[i][j]*(n-i)*j/(n*n-j*i);
	}
	dump(prob[n][n]);
	double res=dp[n][n];

	printf("%.10f\n",res);

	return 0;
}


#include<bits/stdc++.h>
#define REP(i,m) for(int i=0;i<(m);++i)
#define REPN(i,m,in) for(int i=(in);i<(m);++i)
#define ALL(t) (t).begin(),(t).end()
#define CLR(a) memset((a),0,sizeof(a))
#define pb push_back
#define mp make_pair
#define fr first
#define sc second

using namespace std;

#ifndef ONLINE_JUDGE
#define dump(x)  cerr << #x << " = " << (x) << endl
#define prl cerr<<"called:"<< __LINE__<<endl
template<class T> void debug(T a,T b){ for(;a!=b;++a) cerr<<*a<<' ';cerr<<endl;}
#else
#define dump(x) ;
#define prl ;
template<class T> void debug(T a,T b){ ;}
#endif

template<class T> void chmin(T& a,const T& b) { if(a>b) a=b; }
template<class T> void chmax(T& a,const T& b) { if(a<b) a=b; }
typedef long long int lint;
typedef pair<int,int> pi;

namespace std{
	template<class S,class T>
	ostream &operator <<(ostream& out,const pair<S,T>& a){
		out<<'('<<a.fr<<','<<a.sc<<')';
		return out;
	}
}
//const int INF=5e8;

double dp[2005][2005];
int n,m;
double prob[2005][2005];
int mark[2005][2005];
int main(){
	scanf("%d%d",&n,&m);
	REP(i,m){
		int a,b;scanf("%d%d",&a,&b);--a;--b;
		mark[a][b]=1;
	}

	int R=0,C=0;

	REP(i,n){
		int flag=0;
		REP(j,n) flag|=mark[i][j];
		if(flag) ++C;

		flag=0;
		REP(j,n) flag|=mark[j][i];
		if(flag) ++R;
	}

	dp[R][C]=0;
	prob[R][C]=1;
	for(int i=R;i<=n;++i) for(int j=C;j<=n;++j) {
		double expTime=1.0*n*n/(n*n-i*j);
		dp[i+1][i+1]+=(dp[i][j]+expTime*prob[i][j])*(n-i)*(n-j)/(n*n-j*i);
		prob[i+1][j+1]+=prob[i][j]*(n-i)*(n-j)/(n*n-j*i);

		dp[i][j+1]+=(dp[i][j]+expTime*prob[i][j])*i*(n-j)/(n*n-j*i);
		prob[i][j+1]+=prob[i][j]*i*(n-j)/(n*n-j*i);

		dp[i+1][j]+=(dp[i][j]+expTime*prob[i][j])*(n-i)*j/(n*n-j*i);
		prob[i+1][j]+=prob[i][j]*(n-i)*j/(n*n-j*i);
	}
	dump(prob[n][n]);
	double res=dp[n][n];

	printf("%.10f\n",res);

	return 0;
}


#include<bits/stdc++.h>
#define REP(i,m) for(int i=0;i<(m);++i)
#define REPN(i,m,in) for(int i=(in);i<(m);++i)
#define ALL(t) (t).begin(),(t).end()
#define CLR(a) memset((a),0,sizeof(a))
#define pb push_back
#define mp make_pair
#define fr first
#define sc second

using namespace std;

#ifndef ONLINE_JUDGE
#define dump(x)  cerr << #x << " = " << (x) << endl
#define prl cerr<<"called:"<< __LINE__<<endl
template<class T> void debug(T a,T b){ for(;a!=b;++a) cerr<<*a<<' ';cerr<<endl;}
#else
#define dump(x) ;
#define prl ;
template<class T> void debug(T a,T b){ ;}
#endif

template<class T> void chmin(T& a,const T& b) { if(a>b) a=b; }
template<class T> void chmax(T& a,const T& b) { if(a<b) a=b; }
typedef long long int lint;
typedef pair<int,int> pi;

namespace std{
	template<class S,class T>
	ostream &operator <<(ostream& out,const pair<S,T>& a){
		out<<'('<<a.fr<<','<<a.sc<<')';
		return out;
	}
}
//const int INF=5e8;

double dp[2005][2005];
int n,m;
double prob[2005][2005];
int mark[2005][2005];
int main(){
	scanf("%d%d",&n,&m);
	REP(i,m){
		int a,b;scanf("%d%d",&a,&b);--a;--b;
		mark[a][b]=1;
	}

	int R=0,C=0;

	REP(i,n){
		int flag=0;
		REP(j,n) flag|=mark[i][j];
		if(flag) ++C;

		flag=0;
		REP(j,n) flag|=mark[j][i];
		if(flag) ++R;
	}

	dp[R][C]=0;
	prob[R][C]=1;
	for(int i=R;i<=n;++i) for(int j=C;j<=n;++j) if(prob[i][j]>=1e-25){
		if(i==n && j==n) continue;
		double expTime=1.0*n*n/(n*n-i*j)*prob[i][j];
		double all=n*n-j*i;
		double p=(n-i)*(n-j)/all;
		dp[i+1][i+1]+=(dp[i][j]+expTime)*p;
		prob[i+1][j+1]+=prob[i][j]*p;

		p=i*(n-j)/all;
		dp[i][j+1]+=(dp[i][j]+expTime)*p;
		prob[i][j+1]+=prob[i][j]*p;

		p=(n-i)*j/all;
		dp[i+1][j]+=(dp[i][j]+expTime)*p;
		prob[i+1][j]+=prob[i][j]*p;
	}
	dump(prob[n][n]);
	double res=dp[n][n];

	printf("%.15f\n",res);

	return 0;
}


#include<bits/stdc++.h>
#define REP(i,m) for(int i=0;i<(m);++i)
#define REPN(i,m,in) for(int i=(in);i<(m);++i)
#define ALL(t) (t).begin(),(t).end()
#define CLR(a) memset((a),0,sizeof(a))
#define pb push_back
#define mp make_pair
#define fr first
#define sc second

using namespace std;

#ifndef ONLINE_JUDGE
#define dump(x)  cerr << #x << " = " << (x) << endl
#define prl cerr<<"called:"<< __LINE__<<endl
template<class T> void debug(T a,T b){ for(;a!=b;++a) cerr<<*a<<' ';cerr<<endl;}
#else
#define dump(x) ;
#define prl ;
template<class T> void debug(T a,T b){ ;}
#endif

template<class T> void chmin(T& a,const T& b) { if(a>b) a=b; }
template<class T> void chmax(T& a,const T& b) { if(a<b) a=b; }
typedef long long int lint;
typedef pair<int,int> pi;

namespace std{
	template<class S,class T>
	ostream &operator <<(ostream& out,const pair<S,T>& a){
		out<<'('<<a.fr<<','<<a.sc<<')';
		return out;
	}
}
//const int INF=5e8;

double dp[2005][2005];
int n,m;
double prob[2005][2005];
int mark[2005][2005];
int main(){
	scanf("%d%d",&n,&m);
	REP(i,m){
		int a,b;scanf("%d%d",&a,&b);--a;--b;
		mark[a][b]=1;
	}

	int R=0,C=0;

	REP(i,n){
		int flag=0;
		REP(j,n) flag|=mark[i][j];
		if(flag) ++C;

		flag=0;
		REP(j,n) flag|=mark[j][i];
		if(flag) ++R;
	}

	REP(i,2005) REP(j,2005){
		dp[i][j]=prob[i][j]=0;
	}

	dp[R][C]=0;
	prob[R][C]=1;
	for(int i=R;i<=n;++i) for(int j=C;j<=n;++j) if(prob[i][j]>=1e-100){
		if(i==n && j==n) continue;
		double expTime=1.0*n*n/(n*n-i*j)*prob[i][j];
		double all=n*n-j*i;
		double p=(n-i)*(n-j)/all;
		dp[i+1][i+1]+=(dp[i][j]+expTime)*p;
		prob[i+1][j+1]+=prob[i][j]*p;

		p=i*(n-j)/all;
		dp[i][j+1]+=(dp[i][j]+expTime)*p;
		prob[i][j+1]+=prob[i][j]*p;

		p=(n-i)*j/all;
		dp[i+1][j]+=(dp[i][j]+expTime)*p;
		prob[i+1][j]+=prob[i][j]*p;
	}
	dump(prob[n][n]);
	double res=dp[n][n];

	printf("%.15f\n",res);

	return 0;
}


#include<bits/stdc++.h>
#define REP(i,m) for(int i=0;i<(m);++i)
#define REPN(i,m,in) for(int i=(in);i<(m);++i)
#define ALL(t) (t).begin(),(t).end()
#define CLR(a) memset((a),0,sizeof(a))
#define pb push_back
#define mp make_pair
#define fr first
#define sc second

using namespace std;

#ifndef ONLINE_JUDGE
#define dump(x)  cerr << #x << " = " << (x) << endl
#define prl cerr<<"called:"<< __LINE__<<endl
template<class T> void debug(T a,T b){ for(;a!=b;++a) cerr<<*a<<' ';cerr<<endl;}
#else
#define dump(x) ;
#define prl ;
template<class T> void debug(T a,T b){ ;}
#endif

template<class T> void chmin(T& a,const T& b) { if(a>b) a=b; }
template<class T> void chmax(T& a,const T& b) { if(a<b) a=b; }
typedef long long int lint;
typedef pair<int,int> pi;

namespace std{
	template<class S,class T>
	ostream &operator <<(ostream& out,const pair<S,T>& a){
		out<<'('<<a.fr<<','<<a.sc<<')';
		return out;
	}
}
//const int INF=5e8;

double dp[2005][2005];
int n,m;
int mark[2005][2005];
int main(){
	scanf("%d%d",&n,&m);
	REP(i,m){
		int a,b;scanf("%d%d",&a,&b);--a;--b;
		mark[a][b]=1;
	}

	int R=0,C=0;

	REP(i,n){
		int flag=0;
		REP(j,n) flag|=mark[i][j];
		if(flag) ++C;

		flag=0;
		REP(j,n) flag|=mark[j][i];
		if(flag) ++R;
	}

	dp[n][n]=0;
	for(int i=n;i>=R;--i) for(int j=n;j>=C;--j){
		if(i==n && j==n) continue;
		double expTime=1.0*n*n/(n*n-i*j);
		double all=n*n-j*i;
		dump(expTime);
		double p=(n-i)*(n-j)/all;
		dp[i][j]=0;
		dump(p);
		dp[i][j]+=dp[i+1][j+1]*p;
		dump(dp[i][j]);

		p=i*(n-j)/all;
		dump(p);
		dp[i][j]+=dp[i][j+1]*p;
		dump(dp[i][j]);

		p=(n-i)*j/all;
		dump(p);
		dp[i][j]+=dp[i+1][j]*p+expTime;

		dump(i);dump(j);dump(dp[i][j]);
	}
	double res=dp[R][C];

	printf("%.15f\n",res);

	return 0;
}


#include<bits/stdc++.h>
#define REP(i,m) for(int i=0;i<(m);++i)
#define REPN(i,m,in) for(int i=(in);i<(m);++i)
#define ALL(t) (t).begin(),(t).end()
#define CLR(a) memset((a),0,sizeof(a))
#define pb push_back
#define mp make_pair
#define fr first
#define sc second

using namespace std;

#ifndef ONLINE_JUDGE
#define dump(x)  cerr << #x << " = " << (x) << endl
#define prl cerr<<"called:"<< __LINE__<<endl
template<class T> void debug(T a,T b){ for(;a!=b;++a) cerr<<*a<<' ';cerr<<endl;}
#else
#define dump(x) ;
#define prl ;
template<class T> void debug(T a,T b){ ;}
#endif

template<class T> void chmin(T& a,const T& b) { if(a>b) a=b; }
template<class T> void chmax(T& a,const T& b) { if(a<b) a=b; }
typedef long long int lint;
typedef pair<int,int> pi;

namespace std{
	template<class S,class T>
	ostream &operator <<(ostream& out,const pair<S,T>& a){
		out<<'('<<a.fr<<','<<a.sc<<')';
		return out;
	}
}
//const int INF=5e8;

double dp[2005][2005];
int n,m;
double prob[2005][2005];
int mark[2005][2005];
int main(){
	scanf("%d%d",&n,&m);
	REP(i,m){
		int a,b;scanf("%d%d",&a,&b);--a;--b;
		mark[a][b]=1;
	}

	int R=0,C=0;

	REP(i,n){
		int flag=0;
		REP(j,n) flag|=mark[i][j];
		if(flag) ++C;

		flag=0;
		REP(j,n) flag|=mark[j][i];
		if(flag) ++R;
	}

	dp[R][C]=0;
	prob[R][C]=1;
	for(int i=R;i<=n;++i) for(int j=C;j<=n;++j) {
		if(i==n && j==n) continue;
		double expTime=1.0*n*n/(n*n-i*j)*prob[i][j];
		double all=n*n-j*i;
		double p=(n-i)*(n-j)/all;
		dp[i+1][i+1]+=(dp[i][j]+expTime)*p;
		prob[i+1][j+1]+=prob[i][j]*p;

		p=i*(n-j)/all;
		dp[i][j+1]+=(dp[i][j]+expTime)*p;
		prob[i][j+1]+=prob[i][j]*p;

		p=(n-i)*j/all;
		dp[i+1][j]+=(dp[i][j]+expTime)*p;
		prob[i+1][j]+=prob[i][j]*p;
	}
	dump(prob[n][n]);
	double res=dp[n][n];

	printf("%.15f\n",res);

	return 0;
}


#include <cstdio>
using namespace std;

#define Nmax 2002

bool apLine[Nmax], apColumn[Nmax];
double T[Nmax][Nmax];

int main(){
    int N, M, x, y, Lines, Columns;

    scanf ( "%d%d", &N ,&M );

    Lines = Columns = N;

    for ( int i = 1; i <= M; ++i ){
        scanf ( "%d%d", &x, &y );
        if ( !apLine[x] ){
            Lines--;
            apLine[x] = 1;
        }
         if ( !apColumn[y] ){
            Columns--;
            apColumn[y] = 1;
        }
    }

    for ( int i = 1; i <= N; ++i ){
        T[i][0] = T[i-1][0] + 1.0 * N / i;
        T[0][i] = T[0][i-1] + 1.0 * N / i;
    }

    for ( int i = 1; i <= N; ++i ){
        for ( int j = 1; j <= N; ++j ){
            T[i][j] = 1.0 * T[i-1][j] * i * (N-j) +
                      1.0 * T[i][j-1] * j * (N-i) +
                      1.0 * T[i-1][j-1] * i * j;
            T[i][j] /= 1.0 * N * N;
            T[i][j] ++;
            T[i][j] /= ( 1.0 - 1.0 * (N-i) * (N-j) / (N*N) );
        }
    }

    printf ( "%.5lf", T[Lines][Columns] );

    return 0;
}


#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define rep(i, n) for(ll i = 0; i < n; i++)
#define F first
#define S second
typedef long long ll;
using namespace std;

const ll N = 2e3 + 9;
long double dp[N][N];
ll col[N], row[N];
ll n, m, r, c;

int main()
{_
    cin >> n >> m;
    rep(i, m) {
        ll x, y;
        cin >> x >> y;
        c += !col[x];
        r += !row[y];
        col[x] = row[y] = 1;
    }

    dp[n][n] = 0;
    for (ll i = n; i >= 0; i--) {
        for (ll j = n; j >= 0; j--) {
            if (i == n && j == n) continue;
            dp[i][j] = 1;
            long double s, s1, s2, s3, s4;
            s = n * n;
            s4 = i * j;
            s1 = n * i - s4;
            s3 = n * j - s4;
            s2 = s - s1 - s3 - s4;
            dp[i][j] += (s2 / (s - s4)) * dp[i + 1][j + 1];
            dp[i][j] += (s1 / (s - s4)) * dp[i][j + 1];
            dp[i][j] += (s3 / (s - s4)) * dp[i + 1][j];
            dp[i][j] += (s4 / (s - s4));
        }
    }
    cout << fixed << setprecision(6) << dp[r][c];
}


//be naame khodaa

#include <bits/stdc++.h>

typedef long long ll;

using namespace std;

bool mark[2005], mark2[2005];
double e[2005][2005];

int main()
{
	int n, m, r, c;
	cin >> n >> m;
	int a = n, b = n;
	for (int i = 0; i < m; i++)
	{
		cin >> r >> c;
		if (!mark[r]) a--;
		if (!mark2[c]) b--;
		mark[r] = mark2[c] = true;
	}

	e[0][0] = 0;
	for (int i = 1; i <= max(a, b); i++)
	{
		e[i][0] = double(n)/i + e[i-1][0];
		e[0][i] = double(n)/i + e[0][i-1];
	}
	for (int i = 1; i <= a; i++)
		for (int j = 1; j <= b; j++)
		{
			double s1 = double(i)/n, s2 = double(j)/n;
			double S = s1*s2*e[i-1][j-1] + s1*(1-s2)*e[i-1][j] + (1-s1)*s2*e[i][j-1];
			e[i][j] = (S+1)/(1 - (1-s1)*(1-s2));
		}
	cout << setprecision(10) << fixed << e[a][b] << endl;
    return 0;
}


#include <algorithm>
#include <numeric>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <sstream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <utility>

using namespace std;
typedef long long int ll;
const int D = 1000000007;

int main () {
	int n,m;
	cin>>n>>m;
	int row = n;
	int col = n;
	vector<bool > vr(n+1, false);
	vector<bool > vl(n+1, false);

	for(int i=0; i<m; ++i) {
		int a, b;
		scanf("%d%d", &a, &b);
		if(!vr[a])
			--row;
		if(!vl[b])
			--col;
		vr[a] = true;
		vl[b] = true;
	}
	int maxValue = max(row, col);
	vector<vector<double > > dp(maxValue+1, vector<double>(maxValue+1, 0));
	dp[0][0] = 0;

	for(int i=1; i<=maxValue; ++i) {
		dp[i][0] = dp[i-1][0] + n*1.0/i;
		dp[0][i] = dp[0][i-1] + n*1.0/i;
	}

	for(int i=1; i<=row; ++i) {
		for(int j=1; j<=col; ++j) {
			dp[i][j] = n*n + i*j*dp[i-1][j-1] + (n-i)*j*dp[i][j-1] +i*(n-j)*dp[i-1][j];
			dp[i][j] /= (n*(i+j)-i*j);
		}
	}
	printf("%10lf\n", dp[row][col]);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define REP(i,a) for(int i=0,_a=(a); i<_a; i++)
#define EACH(it,a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)
#define SZ(S) ((int) ((S).size()))

#define DEBUG(x) { cout << #x << " = " << x << endl; }
#define PR(a,n) { cout << #a << " = "; FOR(_,1,n) cout << a[_] << ' '; cout << endl; }
#define PR0(a,n) { cout << #a << " = "; REP(_,n) cout << a[_] << ' '; cout << endl; }

const int MN = 2011;

int n;
double f[MN][MN];
bool rows[MN], cols[MN];

int main() {
    ios :: sync_with_stdio(false); cin.tie(NULL);
    cout << (fixed) << setprecision(6);
    while (cin >> n) {
        int row = n, col = n;
        memset(rows, true, sizeof rows);
        memset(cols, true, sizeof cols);
        int q; cin >> q;
        while (q--) {
            int u, v; cin >> u >> v;
            if (rows[u]) rows[u] = false, --row;
            if (cols[v]) cols[v] = false, --col;
        }
        f[0][0] = 0;
        FOR(i,1,n) f[i][0] = f[0][i] = f[i-1][0] + n / (double) i;
        double nn = n * n;
        FOR(x,1,n) FOR(y,1,n) {
            f[x][y] = (1 + (n-x)*y/nn * f[x][y-1] + x*(n-y)/nn * f[x-1][y] + x*y/nn * f[x-1][y-1]) / (1 - (n-x)*(n-y)/nn);
        }
        cout << f[row][col] << endl;
    }
    return 0;
}


#include <cstdio>
#include <set>

using namespace std;

double solved[2001][2001];

double solve(int n, int c, int r){
	if(0 == c && 0 == r)
		return 0.;

	if(c > r)
		swap(c, r);

	if(0 != solved[c][r])
		return solved[c][r];

	double ret = 1.;
	if(c*r > 0)
		ret += c*r*solve(n, c-1, r-1)/(n*n);
	if((n-c)*r > 0)
		ret += (n-c)*r*solve(n, c, r-1)/(n*n);
	if(c*(n-r) > 0)
		ret += c*(n-r)*solve(n, c-1, r)/(n*n);
	ret /= 1. - (n-c)*(n-r)/double(n*n);

	solved[c][r] = ret;
	return ret;
}

int main(){

	int n, m;
	scanf("%d%d", &n, &m);

	set<int> x, y;
	for(int i = 1; i <= n; ++i)
		x.insert(i), y.insert(i);

	for(; m; --m){
		int xi, yi;
		scanf("%d%d", &xi, &yi);
		x.erase(xi);
		y.erase(yi);
	}

	int c = x.size(), r = y.size();

	printf("%.6lf\n", solve(n, c, r));

	return 0;
}


#include <cstdio>
#include <set>
#include <map>
#include <functional>

using namespace std;

double solve(int n, int c, int r){
	if(0 == c && 0 == r)
		return 0.;

	static map<tuple<int, int, int>, double> solved;

	if(c > r)
		swap(c, r);

	auto solved_it = solved.find(make_tuple(n, c, r));
	if(solved.end() != solved_it)
		return solved_it->second;

	double ret = 1.;
	if(c*r > 0)
		ret += c*r*solve(n, c-1, r-1)/(n*n);
	if((n-c)*r > 0)
		ret += (n-c)*r*solve(n, c, r-1)/(n*n);
	if(c*(n-r) > 0)
		ret += c*(n-r)*solve(n, c-1, r)/(n*n);
	ret /= 1. - (n-c)*(n-r)/double(n*n);

	solved[make_tuple(n, c, r)] = ret;
	return ret;
}

int main(){

	int n, m;
	scanf("%d%d", &n, &m);

	set<int> x, y;
	for(int i = 1; i <= n; ++i)
		x.insert(i), y.insert(i);

	for(; m; --m){
		int xi, yi;
		scanf("%d%d", &xi, &yi);
		x.erase(xi);
		y.erase(yi);
	}

	int c = x.size(), r = y.size();

	printf("%.6lf\n", solve(n, c, r));

	return 0;
}


#include <cstdio>
#include <set>
#include <map>
#include <functional>

using namespace std;

double solve(int n, int c, int r){
	if(0 == c && 0 == r)
		return 0.;

	static map<tuple<int, int, int>, double> solved;

	auto solved_it = solved.find(make_tuple(n, c, r));
	if(solved.end() != solved_it)
		return solved_it->second;

	double ret = 1.;
	if(c*r > 0)
		ret += c*r*solve(n, c-1, r-1)/(n*n);
	if((n-c)*r > 0)
		ret += (n-c)*r*solve(n, c, r-1)/(n*n);
	if(c*(n-r) > 0)
		ret += c*(n-r)*solve(n, c-1, r)/(n*n);
	ret /= 1. - (n-c)*(n-r)/double(n*n);

	solved[make_tuple(n, c, r)] = ret;
	return ret;
}

int main(){

	int n, m;
	scanf("%d%d", &n, &m);

	set<int> x, y;
	for(int i = 1; i <= n; ++i)
		x.insert(i), y.insert(i);

	for(; m; --m){
		int xi, yi;
		scanf("%d%d", &xi, &yi);
		x.erase(xi);
		y.erase(yi);
	}

	int c = x.size(), r = y.size();

	printf("%.6lf\n", solve(n, c, r));

	return 0;
}


#include <cstdio>
#include <set>
#include <unordered_map>

using namespace std;

size_t hash_combiner(size_t left, size_t right) //replacable
{ return left^right;}

template<int index, class...types>
struct hash_impl {
size_t operator()(size_t a, const std::tuple<types...>& t) const {
typedef typename std::tuple_element<index, std::tuple<types...>>::type nexttype;
hash_impl<index-1, types...> next;
size_t b = std::hash<nexttype>()(std::get<index>(t));
return next(hash_combiner(a, b), t);
}
};
template<class...types>
struct hash_impl<0, types...> {
size_t operator()(size_t a, const std::tuple<types...>& t) const {
typedef typename std::tuple_element<0, std::tuple<types...>>::type nexttype;
size_t b = std::hash<nexttype>()(std::get<0>(t));
return hash_combiner(a, b);
}
};

template<class...types>
struct my_hash {
size_t operator()(const std::tuple<types...>& t) const{
const size_t begin = std::tuple_size<std::tuple<types...>>::value-1;
return hash_impl<begin, types...>()(1, t); //1 should be some largervalue
}
};

double solve(int n, int c, int r){
	if(0 == c && 0 == r)
		return 0.;

	static unordered_map<tuple<int, int, int>, double, my_hash<int, int, int>> solved;

	if(c > r)
		swap(c, r);

	auto solved_it = solved.find(make_tuple(n, c, r));
	if(solved.end() != solved_it)
		return solved_it->second;

	double ret = 1.;
	if(c*r > 0)
		ret += c*r*solve(n, c-1, r-1)/(n*n);
	if((n-c)*r > 0)
		ret += (n-c)*r*solve(n, c, r-1)/(n*n);
	if(c*(n-r) > 0)
		ret += c*(n-r)*solve(n, c-1, r)/(n*n);
	ret /= 1. - (n-c)*(n-r)/double(n*n);

	solved[make_tuple(n, c, r)] = ret;
	return ret;
}

int main(){

	int n, m;
	scanf("%d%d", &n, &m);

	set<int> x, y;
	for(int i = 1; i <= n; ++i)
		x.insert(i), y.insert(i);

	for(; m; --m){
		int xi, yi;
		scanf("%d%d", &xi, &yi);
		x.erase(xi);
		y.erase(yi);
	}

	int c = x.size(), r = y.size();

	printf("%.6lf\n", solve(n, c, r));

	return 0;
}


#include <cstdio>
#include <set>
#include <unordered_map>
#include <tuple>

using namespace std;

size_t hash_combiner(size_t left, size_t right) //replacable
{ return left^right;}

template<int index, class...types>
struct hash_impl {
size_t operator()(size_t a, const std::tuple<types...>& t) const {
typedef typename std::tuple_element<index, std::tuple<types...>>::type nexttype;
hash_impl<index-1, types...> next;
size_t b = std::hash<nexttype>()(std::get<index>(t));
return next(hash_combiner(a, b), t);
}
};
template<class...types>
struct hash_impl<0, types...> {
size_t operator()(size_t a, const std::tuple<types...>& t) const {
typedef typename std::tuple_element<0, std::tuple<types...>>::type nexttype;
size_t b = std::hash<nexttype>()(std::get<0>(t));
return hash_combiner(a, b);
}
};

template<class...types>
struct my_hash {
size_t operator()(const std::tuple<types...>& t) const{
const size_t begin = std::tuple_size<std::tuple<types...>>::value-1;
return hash_impl<begin, types...>()(1, t); //1 should be some largervalue
}
};

double solve(int n, int c, int r){
	if(0 == c && 0 == r)
		return 0.;

	static unordered_map<tuple<int, int, int>, double, my_hash<int, int, int>> solved;

	if(c > r)
		swap(c, r);

	auto solved_it = solved.find(make_tuple(n, c, r));
	if(solved.end() != solved_it)
		return solved_it->second;

	double ret = 1.;
	if(c*r > 0)
		ret += c*r*solve(n, c-1, r-1)/(n*n);
	if((n-c)*r > 0)
		ret += (n-c)*r*solve(n, c, r-1)/(n*n);
	if(c*(n-r) > 0)
		ret += c*(n-r)*solve(n, c-1, r)/(n*n);
	ret /= 1. - (n-c)*(n-r)/double(n*n);

	solved[make_tuple(n, c, r)] = ret;
	return ret;
}

int main(){

	int n, m;
	scanf("%d%d", &n, &m);

	set<int> x, y;
	for(int i = 1; i <= n; ++i)
		x.insert(i), y.insert(i);

	for(; m; --m){
		int xi, yi;
		scanf("%d%d", &xi, &yi);
		x.erase(xi);
		y.erase(yi);
	}

	int c = x.size(), r = y.size();

	printf("%.6lf\n", solve(n, c, r));

	return 0;
}


#include <cstdio>
#include <set>
#include <unordered_map>

using namespace std;

size_t hash_combiner(size_t left, size_t right) //replacable
{ return left^right;}

template<int index, class...types>
struct hash_impl {
size_t operator()(size_t a, const std::tuple<types...>& t) const {
typedef typename std::tuple_element<index, std::tuple<types...>>::type nexttype;
hash_impl<index-1, types...> next;
size_t b = std::hash<nexttype>()(std::get<index>(t));
return next(hash_combiner(a, b), t);
}
};
template<class...types>
struct hash_impl<0, types...> {
size_t operator()(size_t a, const std::tuple<types...>& t) const {
typedef typename std::tuple_element<0, std::tuple<types...>>::type nexttype;
size_t b = std::hash<nexttype>()(std::get<0>(t));
return hash_combiner(a, b);
}
};

namespace std {
template<class...types>
struct hash<std::tuple<types...>> {
size_t operator()(const std::tuple<types...>& t) const{
const size_t begin = std::tuple_size<std::tuple<types...>>::value-1;
return hash_impl<begin, types...>()(1, t); //1 should be some largervalue
}
};
}

double solve(int n, int c, int r){
	if(0 == c && 0 == r)
		return 0.;

	static unordered_map<tuple<int, int, int>, double> solved;

	if(c > r)
		swap(c, r);

	auto solved_it = solved.find(make_tuple(n, c, r));
	if(solved.end() != solved_it)
		return solved_it->second;

	double ret = 1.;
	if(c*r > 0)
		ret += c*r*solve(n, c-1, r-1)/(n*n);
	if((n-c)*r > 0)
		ret += (n-c)*r*solve(n, c, r-1)/(n*n);
	if(c*(n-r) > 0)
		ret += c*(n-r)*solve(n, c-1, r)/(n*n);
	ret /= 1. - (n-c)*(n-r)/double(n*n);

	solved[make_tuple(n, c, r)] = ret;
	return ret;
}

int main(){

	int n, m;
	scanf("%d%d", &n, &m);

	set<int> x, y;
	for(int i = 1; i <= n; ++i)
		x.insert(i), y.insert(i);

	for(; m; --m){
		int xi, yi;
		scanf("%d%d", &xi, &yi);
		x.erase(xi);
		y.erase(yi);
	}

	int c = x.size(), r = y.size();

	printf("%.6lf\n", solve(n, c, r));

	return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define db double

using namespace std;

const int maxn=2000,maxstep=2000;
bool h[maxn+1],l[maxn+1];
int nh,nl,n,m;
db d[maxn+1][maxn+1];

void reloc()
{
    freopen("/Users/admin/Desktop/cards.in","r",stdin);
    freopen("/Users/admin/Desktop/cards.out","w",stdout);
    return;
}

void read()
{
    int a,b;
    scanf("%d%d",&n,&m);
    memset(h,0,sizeof(h));
    memset(l,0,sizeof(l));
    nh=nl=0;
    rep(i,1,m)
    {
        scanf("%d%d",&a,&b);
        if(h[a]==0)nh++;
        if(l[b]==0)nl++;
        h[a]=1,l[b]=1;

    }
    return;
}

inline db dp(int i,int j)
{
    if(i<0||j<0)return 0;
    if((i==0&&j==0)||d[i][j]>0.000001)return d[i][j];
    d[i][j]=(1.0*(n*n+dp(i-1,j)*i*(n-j)+dp(i,j-1)*j*(n-i)+dp(i-1,j-1)*j*i))/(1.0*(n*n-(n-j)*(n-i)));
    return d[i][j];
}

void Dp()
{
    rep(i,0,n)rep(j,0,n)d[i][j]=0;
    printf("%.10f\n",dp(n-nh,n-nl));
    return;
}

int main()
{
    //reloc();
    read();
    Dp();
    return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define db long double

using namespace std;

const int maxn=2000,maxstep=2000;
bool h[maxn+1],l[maxn+1];
int nh,nl,n,m;
db d[maxn+1][maxn+1];

void reloc()
{
    freopen("/Users/admin/Desktop/cards.in","r",stdin);
    freopen("/Users/admin/Desktop/cards.out","w",stdout);
    return;
}

void read()
{
    int a,b;
    scanf("%d%d",&n,&m);
    memset(h,0,sizeof(h));
    memset(l,0,sizeof(l));
    nh=nl=0;
    rep(i,1,m)
    {
        scanf("%d%d",&a,&b);
        if(h[a]==0)nh++;
        if(l[b]==0)nl++;
        h[a]=1,l[b]=1;

    }
    return;
}

inline db dp(int i,int j)
{
    if(i<0||j<0)return 0;
    if((i==0&&j==0)||d[i][j]>0.000001)return d[i][j];
    d[i][j]=(1.0*(n*n+dp(i-1,j)*i*(n-j)+dp(i,j-1)*j*(n-i)+dp(i-1,j-1)*j*i))/(1.0*(n*n-(n-j)*(n-i)));
    return d[i][j];
}

void Dp()
{
    rep(i,0,n)rep(j,0,n)d[i][j]=0;
    printf("%.10Lf\n",dp(n-nh,n-nl));
    return;
}

int main()
{
    //reloc();
    read();
    Dp();
    return 0;
}


#include <algorithm>

#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#include <string>
#include <vector>
#include <iostream>

using namespace std;

#define TRACE(x) cout << #x << " = " << x << endl
#define REP(i, n) for (int i = 0; i < (n); ++i)

typedef long long llint;

const int MAXN = 2002;

double f[MAXN][MAXN];
bool bior[MAXN], bioc[MAXN];

int main(void) {
  int n, k;
  scanf("%d %d", &n, &k);
  REP(i, k) {
    int r, c;
    scanf("%d %d", &r, &c); --r, --c;
    bior[r] = bioc[c] = true;
  }

  int a = 0, b = 0;
  REP(i, n) {
    if (!bior[i]) a++;
    if (!bioc[i]) b++;
  }

  REP(i, a+1) REP(j, b+1) {
    if (i == 0 && j == 0) {
      f[i][j] = 0;
      continue;
    }

    double pij = double(i)/n*double(j)/n;
    double pi = double(i)/n - pij;
    double pj = double(j)/n - pij;
    double p0 = 1 - pi - pj - pij;

    f[i][j] = 1;
    if (i > 0) f[i][j] += pi*f[i-1][j];
    if (j > 0) f[i][j] += pj*f[i][j-1];
    if (i > 0 && j > 0) f[i][j] += pij*f[i-1][j-1];
    f[i][j] /= (1 - p0);
  }

  printf("%lf\n", f[a][b]);
  return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <stack>
#include <climits>
#include <deque>
#include <bitset>
#include <cassert>
#include <ctime>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
const int dy[]={-1,0,1,0},dx[]={0,1,0,-1};
// adjust problem by problem
const double EPS=1e-8;
const double PI=acos(-1.0);
#define REP(i,n) for(int i=0;i<(int)n;++i)
#ifdef __GNUC__
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
int popcount(int n){return __builtin_popcount(n);}
int popcount(ll n){return __builtin_popcountll(n);}
#endif
#ifndef __GNUC__
template<class T> int popcount(T val){
  val = val - ((val >> 1) & 0x55555555);
  val = (val & 0x33333333) + ((val >> 2) & 0x33333333);
  val = (val + (val >> 4)) & 0x0f0f0f0f;
  val += val >> 8;
  val += val >> 16;
  return (int)(val & 0x0000003f);
}
#endif
template<class T>int SIZE(T a){return a.size();}
template<class T>string IntToString(T num){string res;stringstream ss;ss<<num;return ss.str();}
template<class T>T StringToInt(string str){T res=0;for(int i=0;i<SIZE(str);i++)res=(res*10+str[i]-'0');return res;}
template<class T>T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template<class T>T lcm(T a,T b){return a/gcd(a,b)*b;}
template<class T> void PrintSeq(T &a,int sz){for(int i=0;i<sz;i++){cout<<a[i];if(sz==i+1)cout<<endl;else cout<<' ';}}
ll getTen(int a){return (a<=0)?1:(getTen(a-1)*10);}
bool EQ(double a,double b){return abs(a-b)<EPS;}
void fastStream(){cin.tie(0);std::ios_base::sync_with_stdio(0);}
vector<string> split(string str,char del){
  vector<string> res;
  for(int i=0,s=0;i<SIZE(str);i++){
    if(str[i]==del){if(i-s!=0)res.push_back(str.substr(s,i-s));s=i+1;}
    else if(i==SIZE(str)-1){res.push_back(str.substr(s));}
  }
  return res;
}

double dp[2][2010];
int ys[2010];
int xs[2010];
int N,M;
int main(){

  cin>>N>>M;
  int r=0,c=0;
  for(int i=0;i<M;i++){
    int x,y;
    cin>>y>>x;
    y--;x--;
    ys[y]=1,xs[x]=1;
  }
  for(int i=0;i<2010;i++)
    r+=ys[i],c+=xs[i];
  for(int i=N;i>=r;i--){
    const int cur=i%2;
    const int nxt=cur^1;
    for(int j=N;j>=c;j--){
      double res=0;
      if(i==N&&j==N)res=0;
      else{
        double p1=(1.0*N-i)/N;
        double p2=(1.0*N-j)/N;
        //cout<<i<<" "<<j<<endl;
        // cout<<p1<<" "<<p2<<endl;
        res++;
        res+=p1*p2*dp[nxt][j+1];
        res+=p1*(1-p2)*dp[nxt][j];
        res+=(1-p1)*p2*dp[cur][j+1];
        res/=(1-(1-p1)*(1-p2));
      }
      dp[cur][j]=res;
    }
  }
  printf("%.10f\n",dp[r%2][c]);
  return 0;
}


#include<algorithm>
#include<bitset>
#include<cassert>
#include<complex>
#include<cstdio>
#include<cstring>
#include<iomanip>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<vector>
#define FOR(i, a, b) for(int i =(a); i <=(b); ++i)
#define FORD(i, a, b) for(int i = (a); i >= (b); --i)
#define REP(i, n) for(int i = 0;i <(n); ++i)
#define VAR(v, i) __typeof(i) v=(i)
#define FORE(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define PB push_back
#define MP make_pair
#define X first
#define Y second
#define debug(x) {cerr <<#x <<" = " <<x <<endl; }
#define debugv(x) {{cerr <<#x <<" = "; FORE(itt, (x)) cerr <<*itt <<", "; cerr <<endl; }}
using namespace std;
typedef long long LL;
typedef long double LD;
typedef pair<int, int> PII;
typedef vector<int> VI;

template<class C> void mini(C&a4, C b4){a4=min(a4, b4); }
template<class C> void maxi(C&a4, C b4){a4=max(a4, b4); }
template<class T1, class T2>
ostream& operator<< (ostream &out, pair<T1, T2> pair) { return out << "(" << pair.X << ", " << pair.Y << ")";}

int main(){
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    int n,m;
    cin >> n >> m;
    int R = n, C = n;
    vector<bool> row(n, false), col(n, false);
    REP(i, m) {
        int x,y;
        cin >> x >> y;
        --x;--y;
        if (!row[x]) {
            row[x] =  true;
            --R;
        }
        if (!col[y]) {
            col[y] = true;
            --C;
        }
    }
    vector<vector<LD> > ans(n+1, vector<LD>(n+1, 0));
    LD over = 1.0l/(n*n);
    REP(i,R+1) REP(j, C+1) {
        if (i == 0 && j == 0) ans[i][j] = 0;
        else {
            LD xtr = 0;
            if (i > 0 && j > 0) xtr += (i*j)*over*(ans[i-1][j-1]);
            if (i > 0) xtr += i*(n-j)*over*(ans[i-1][j]);
            if (j > 0) xtr += j*(n-i)*over*(ans[i][j-1]);
            ans[i][j] = (1+xtr)/(1-(n-i)*(n-j)*over);
        }
    }
    cout << ans[R][C] << endl;

    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<set>
#include<ctime>
#include<vector>
#include<queue>
#include<algorithm>
#include<map>
#include<cmath>
#define inf 1000000000
#define rad 100000000
#define pa pair<int,int>
#define ll long long
using namespace std;
int read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
double dp[2005][2005];
int n,m,t1,t2;
bool r[2005],c[2005];
int main()
{
	n=read();m=read();
	t1=t2=n;
	for(int i=1;i<=m;i++)
	{
		int x=read(),y=read();
		if(!r[x])r[x]=1,t1--;
		if(!r[y])c[y]=1,t2--;
	}
	dp[0][0]=0;
	for(int i=1;i<=n;i++)
	{
		dp[i][0]=dp[i-1][0]+(double)n/i;
		dp[0][i]=dp[0][i-1]+(double)n/i;
	}
	for(int i=1;i<=t1;i++)
		for(int j=1;j<=t2;j++)
	    {
			dp[i][j]=n*n;
			dp[i][j]+=i*j*dp[i-1][j-1];
			dp[i][j]+=i*(n-j)*dp[i-1][j];
			dp[i][j]+=j*(n-i)*dp[i][j-1];
			dp[i][j]/=(n*n-(n-i)*(n-j));
		}
	printf("%.10lf\n",dp[t1][t2]);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<set>
#include<ctime>
#include<vector>
#include<queue>
#include<algorithm>
#include<map>
#include<cmath>
#define inf 1000000000
#define rad 100000000
#define pa pair<int,int>
#define ll long long
using namespace std;
int read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
double dp[2005][2005];
int n,m,t1,t2;
bool r[2005],c[2005];
int main()
{
	n=read();m=read();
	t1=t2=n;
	for(int i=1;i<=m;i++)
	{
		int x=read(),y=read();
		if(!r[x])r[x]=1,t1--;
		if(!c[y])c[y]=1,t2--;
	}
	dp[0][0]=0;
	for(int i=1;i<=n;i++)
	{
		dp[i][0]=dp[i-1][0]+(double)n/i;
		dp[0][i]=dp[0][i-1]+(double)n/i;
	}
	for(int i=1;i<=t1;i++)
		for(int j=1;j<=t2;j++)
	    {
			dp[i][j]=n*n;
			dp[i][j]+=i*j*dp[i-1][j-1];
			dp[i][j]+=i*(n-j)*dp[i-1][j];
			dp[i][j]+=j*(n-i)*dp[i][j-1];
			dp[i][j]/=(n*n-(n-i)*(n-j));
		}
	printf("%.10lf\n",dp[t1][t2]);
	return 0;
}