Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main(){
- int t;
- cin>>t;
- while(t--){
- int n;
- cin>>n;
- int x = (double)log(n)/(double)log(2);
- int ans = n-1-x;
- cout<<ans<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement