1 //codeforces 559C|51nod1486 Gerald and Giant Chess(组合数学+逆元) 2 3 #include4 using namespace std; 5 #define LL long long 6 typedef pair pii; 7 const int inf = 0x3f3f3f3f; 8 const int N =2e5+10; 9 #define clc(a,b) memset(a,b,sizeof(a))10 const double eps = 1e-8;11 const int MOD = 1e9+7;12 void fre() {freopen("in.txt","r",stdin);}13 void freout() {freopen("out.txt","w",stdout);}14 inline int read() { int x=0,f=1;char ch=getchar();while(ch>'9'||ch<'0') { if(ch=='-') f=-1;ch=getchar();}while(ch>='0'&&ch<='9') {x=x*10+ch-'0';ch=getchar();}return x*f;}15 16 struct Point{17 int x,y;18 Point(){}19 Point(int _x,int _y):x(_x),y(_y){}20 bool operator <(const Point &rhs) const{21 if(x==rhs.x) return y >=1;x=1ll*x*x%MOD;33 }34 return ret; 35 }36 int C(int n,int m){37 if(n