#include <iostream>
#include <string>
#include <algorithm>
#define BIG 1000000000
using namespace std;
typedef long long ll;
vector<char> res;
int ok;
// 求全排列C(n,m),如果越界,返回BIG
long long Col(ll n, ll m){
m = (n - m) < m ? (n - m) : m;
ll div = m;
ll ret = 1;
for(ll i=n; i>=n-m+1; i--){
ret *= i;
while(ret % div==0 && div!=1)
ret/= div--;
if(ret<0)//越界啦
return BIG;
}
return ret;
}