#include #include #include #include #include #define N 10005 #define LL long long #define inf 1<<29 #define eps 1e-7 using namespace std; int n,a[100],m,k,cnt,sg[1005]; int get_sg(int n){ if(sg[n]!=-1) return sg[n]; int vis[10000]; memset(vis,0,sizeof(vis)); for(int i=0;i