#include #define int long long using namespace std; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; } const int mod=1e9+7; signed main() { cin.tie(0); ios::sync_with_stdio(false); int d,l,r,k; cin>>d>>l>>r>>k; int n=1<<(d-1); vector> G(2*n); for(int i=1;i dist(2*n); function dfs=[&](int v,int p){ for(int u:G[v]) if(u!=p){ dist[u]=dist[v]+1; dfs(u,v); } }; int heightL=32-__builtin_clz(l); int heightR=32-__builtin_clz(r); // cout< fact(1<