Advertisement
Ankit_132

C

Jan 24th, 2024
809
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int t;
  6.     cin>>t;
  7.    
  8.     while(t--){
  9.         int x;
  10.         cin>>x;
  11.        
  12.         for(int b=30; b>=0; b--){
  13.             if(((1<<b)&x) > 0){
  14.                 cout<<x - (1<<b)<<" "<<(1<<b)<<"\n";
  15.                 break;
  16.             }
  17.         }
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement