link/cut tree
[kudsource.git] / POJ / 2309.c
blob06f5bbcf53b4acced01550b03f6ccfab22951fab
1 #include <stdio.h>
3 int lowbit(int x) { return x & -x; }
5 int main() {
6 int tcase,n,delta;
7 scanf("%d",&tcase);
8 while (tcase--) {
9 scanf("%d",&n);
10 delta=n-lowbit(n);
11 n-=delta;
12 printf("%d %d\n",1+delta,n*2-1+delta);
14 return 0;