Advertisement
Forna99

Untitled

Jul 20th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main () {
  5.  
  6.  long long  int q,n,l,i;
  7. cin >> q;
  8. for (i=1;i<=q;i++) {
  9.     cin >> n;
  10.     l = (2*(n-pow(2,floor(log2(n)))))+1;
  11.     cout<<l<<endl;
  12.    
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement