Under construction

Still being built. Things may change

Microcircuits

Interview

Time limit2sMemory limit1024 MB

Summary
Count the ways to draw exactly k non-crossing lines between n contacts placed on a circle, where each line joins two contacts.
Level

Medium4 of 10

Topics
Combinatorics, Math
Solved
No attempts yet

Problem

You probably know what microcircuits look like. Pay close attention to the connections. Contacts on the circuit are joined by lines. If two lines do not intersect, there is no connection between their respective contacts.

You hold a circular circuit with nn contacts around its border. Count the ways to draw exactly kk non-intersecting lines, each connecting two of the contacts.

Input

A single line contains two integers nn and kk (1≤k≤n≤401 \le k \le n \le 40).

Output

Print the required number.

Examples2

  1. Example 1

    Input
    4 2
    
    Expected output
    2
    
  2. Example 2

    Input
    4 3
    
    Expected output
    0