Created
July 15, 2017 04:13
-
-
Save chanjungkim/71436a73281c0a0565382571431f38c2 to your computer and use it in GitHub Desktop.
2775 bunyu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
class Main{ | |
static long[][] d = new long[15][15]; | |
public static void main(String[] args){ | |
Scanner sc = new Scanner(System.in); | |
int t=sc.nextInt(); | |
int[][] tCase = new int[t][2]; | |
for(int i = 0 ; i < t ; i++){ | |
tCase[i][0]=sc.nextInt(); | |
tCase[i][1]=sc.nextInt(); | |
go(tCase[i][0], tCase[i][1]); | |
} | |
} | |
public static void go(int a, int b){ | |
int sum; | |
for(int i = 1 ; i <= b ; i++){ | |
d[0][i]=i; | |
} | |
for(int i = 1; i <= a ; i++){ | |
sum=0; | |
int j=1; | |
for(; j <= b ; j++){ | |
sum+=d[i-1][j]; | |
d[i][j]=sum; | |
} | |
} | |
System.out.println(d[a][b]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment