import java.util.Scanner; // 逻辑应该是对的 只是未在规定时间内输出 // 可是我不加N'的逻辑,只是接收加一个输出就已经超时了 public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for (int i = 0; i < t; i++) { long n = sc.nextLong(); int value = 0; // fn = n的二进制数中的1的个数 String ss = Long.toBinaryString(n); for (int j = 0; j < ss.length(); j++) { if (ss.charAt(j) == '1') { value ++; } } long n1 = (long)(Math.pow(2, value) - 1); System.out.println(value + " " + n1); // System.out.println(n + " "); } } }