#include #define rep(i,a,b) for(int i=a;i=b;i--) #define fore(i,a) for(auto &i:a) #define all(x) (x).begin(),(x).end() using namespace std; typedef long long ll; typedef pair P; int INF = 1e5; ll MOD = 1e3; int main(){ int N; cin >> N; int dp[1<> product[i]; rep(msk,0,1<