import com.sun.corba.se.spi.orbutil.fsm.Input;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
private long count=1;
public void back(){
this.count=1;
}
public long hannota(int n,int k){
if(n==1)
return 1;
else {
if(n-1>=k)
count=2*count;
return 2*hannota(n-1,k)+1;
}
}
public static void main(String[] args) {
Main fab=new Main();
Scanner Input = new Scanner(System.in);
int a=Input.nextInt();
while (a>0)
{
int n=Input.nextInt();
int k=Input.nextInt();
fab.hannota(n,k);
System.out.println(fab.count);
fab.back();
a--;
}
}
}
杭电OJ--1995
最新推荐文章于 2020-03-18 21:58:09 发布