12924 - Pascal's Triangle   

Description

In Pascal's triangle, each number is the sum of the two numbers directly above it.

Given two integers R, C to represents the index inside a Pascal’s triangle. Please write a C program to calculate its value. E.g. R = 4, C = 2. Value is 6.

Hint: if C equals to 0 or R. Value is 1.

Note:

  1. Would not give numbers which means illegal index inside Pascal’s triangle. E.g. R = 1, C = 3 (X)

Input

Two integers R(row), C(column).

Note:

  1. 32,767 >= R, C >= 0

Output

Output should follow below format:

N

Note that:

  1. Need to have a return value('\n') at the end of your string.

Sample Input  Download

Sample Output  Download

Tags




Discuss