#include using namespace std; int dp[(1<<18)][18]; const int INF=1e9; int main(){ int N; cin >> N; int a[N],b[N]; for(int i=0;i> a[i] >> b[i]; } for(int i=0;i<(1<