Microcircuits
InterviewTime limit2sMemory limit1024 MB
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 contacts around its border. Count the ways to draw exactly non-intersecting lines, each connecting two of the contacts.
Input
A single line contains two integers and ().
Output
Print the required number.