#include using namespace std; int n; bool used[10001]; int bfs(int i) { used[i]=1; if(i==n)return 1; int x=__builtin_popcount(i); int ans1=-1,ans2=-1; if(i-x>0&&!used[i-x])ans1=bfs(i-x); if(i+x<=n&&!used[i+x])ans2=bfs(i+x); if(ans1==-1&&ans2==-1)return -1; else { if(ans1==-1)return ans2+1; else if(ans2==-1)return ans1+1; else return (ans1>n; cout<