Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main () {
- long long int q,n,l;
- cin >> q;
- for (int i=0;i<q;i++) {
- cin >> n;
- l = 2*(n-pow(2,floor(log2(n))))+1;
- cout<<l<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement