Out of the two test cases, this solution passes just one!
import java.io.*;
import java.util.*;
class GFG {
public static void main (String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
long a=sc.nextLong();
long f=0,c=0;
long d2=1;
long d1=1;
long pro=0;
for(int i=1;;i++){
f+=a;
c=(long)Math.pow(2,i);
if(f-c>pro){
pro=f-c;
d2=i;
}
if(f-c>0) d1=i;
if(f-c<=0) break;
}
System.out.println(d1+" "+d2);
}
}
}