/*dp棋盘*/ import java.util.*; public class Main{ public static void main(String[] arg){ Scanner s=new Scanner(System.in); while(s.hasNextLine()){ String input=s.nextLine(); String[] arr=input.split(" "); System.out.println(getDp(Integer.valueOf(arr[0]),Integer.valueOf(arr[1]))); } } private static int getDp(int n,int m){ int[][] dp=new int[n+1][m+1]; for(int count =0;count<n+1;count++){ dp[count][0]=1; } for(int count =0;count<m+1;count++){ dp[0][count]=1; } for(int i=1;i<n+1;i++){ for(int j=1;j<m+1;j++){ dp[i][j]=dp[i][j-1]+dp[i-1][j]; } } return dp[n][m]; } } /*recursive 棋盘*/ import java.util.*; public class Main{ public static void main(String[] arg){ Scanner s=new Scanner(System.in); while(s.hasNextLine()){ String input=s.nextLine(); String[] arr=input.split(" "); System.out.println(getRecursive(0,0,Integer.valueOf(arr[0]),Integer.valueOf(arr[1]))); } } private static int getRecursive(int x,int y,int n,int m){ if(x==n){ return 1; } if(y==m){ return 1; } return getRecursive(x+1,y,n,m)+getRecursive(x,y+1,n,m); } }