Help me in solving XORABC problem

My issue

I am getting the intuiton behind the question. How do we know that if x is 2 to power something we get -1.

My code

#include <bits/stdc++.h>
#define endl '\n'
#define int ll
using namespace std;

typedef long long ll;

void solve(){
        
  int x; cin>>x;
//   vector<int>  v(n); for(int i=0;i<n;i++)  { int x; cin>>x; v.push_back(x); }
  
  if(x%2!=0) { cout<<-1<<endl; return;}
   else{
     
}
 
}

signed main() {
    
ios_base::sync_with_stdio(0);cin.tie(0); cout.tie(0);
  int t; cin>>t;
   while(t--)
       
solve();

       


}

Problem Link: XORABC Problem - CodeChef

@sh_reya
yes u got it right that when x is power of 2 then it would be -1 and also x has to be even because u can’t make x when x is odd .
just feel it like when u will make x as odd then one of them needs to be odd atleast so what are outcomes likey to be
(odd , odd , odd) and (odd , odd , even) and (odd ,even ,even)
and when u perform xor of these u will never get an odd number as output so x needs to be even and also not power of two .

And to check x to be power of 2 just use log2 function .
if the flooring and ceiling values of log2(x) are same then it will be power of two else its not.