This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;cin>>t;
int arr[12];
arr[0]=1;
for(int i=1;i<12;i++){
arr[i]=arr[i-1]*2;
}
while(t--){
int x;cin>>x;
if(x==1){
cout<<2<<"\n"<<-1<<"\n";
continue;
}
for(int i=11;i>-1;i--){
if(x>arr[i]){
cout<<arr[i+1]<<"\n"<<-1<<"\n";
i=-1;
}
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |