eolymp
bolt
Try our new interface for solving problems
published at 4/10/24, 4:34:48 pm

include <iostream>

using namespace std; int main() { int n,s=1,a; cin>>n; while(s*2<=n){ s*=2; } a=n-s; if(a==0){ cout<<"0"; }else{ cout<<a; }

return 0;

}