#include #define LL long long #define ull unsigned long long #define ULL ull #define mp make_pair #define pii pair #define piii pair #define pll pair #define pb push_back #define big 20160116 #define INF 2147483647 #define pq priority_queue #define rank rk124232 #define y1 y20160116 #define y0 y20160110 using namespace std; inline 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; } namespace Mymath{ LL qp(LL x,LL p,LL mod){ LL ans=1; while (p){ if (p&1) ans=ans*x%mod; x=x*x%mod; p>>=1; } return ans; } LL inv(LL x,LL mod){ return qp(x,mod-2,mod); } LL C(LL N,LL K,LL fact[],LL mod){ return fact[N]*inv(fact[K],mod)%mod*inv(fact[N-K],mod)%mod; } template Tp gcd(Tp A,Tp B){ if (B==0) return A; return gcd(B,A%B); } template Tp lcm(Tp A,Tp B){ return A*B/gcd(A,B); } }; namespace fwt{ using namespace Mymath; void FWT(int a[],int n,LL mod) { for(int d=1;d