#include using namespace std; map,long long>dp; long long fn(int m,int n) {//cout<1)ans1=1+fn(m/2,n)+fn(m-m/2,n); if(n>1)ans2=1+fn(m,n/2)+fn(m,n-n/2); return dp[make_pair(m,n)]=min(ans1,ans2); } int main() { int n,m; cin>>n>>m; cout<