int M[15];
unsigned long long nn,m;
unsigned long long gcd(unsigned long long a,unsigned long long b ){
return b == 0?a:gcd(b,a%b);
}
unsigned long long lcm(unsigned long long a,unsigned long long b){
return (a*b)/(gcd(a,b));
}
unsigned long long ...