#include #include #define MAX(a,b) ((a)>(b)?(a):(b)) #define MIN(a,b) ((a)<(b)?(a):(b)) #define POS(i,j) ((i)*(1<0) return dp[POS(l,bit)]; if(bit==0) return 0; int local=2001; for(int i=0;i>i)&1)==0) continue; int v=calc(i,bit^(1<