Title Description
Description
On a circle, there are 2*k of different nodes, we use these points as the endpoints, even the K-line segments, so that each node is exactly one time. Please calculate how many lines are available to satisfy these segments by dividing the circle into the least part
Enter a description
Input Description
One row only, an integer K (1<=k<=30)
Output description
Output Description
Two spaces separated by a space, the latter is a minimum of a few pieces of the circle, the former is the number of programs connected under this premise
Sample input
Sample Input
2
Sample output
Sample Output
2 3
/*for any point on the circle A, can and any points of connection will be divided into two halves, the premise is that the number of points on both sides of the circle is even, then the circle is divided into the same way on both sides, known as Cattleya*/#include<cstdio>#include<iostream>#defineM 35using namespacestd;Long LongCa[m];intMain () {intN; scanf ("%d",&N); ca[0]=1; for(intI=1; i<=n;i++) Ca[i]=(4*i-2) *ca[i-1]/(i+1); printf ("%lld%d", ca[n],n+1); return 0;}View Code
Circle (Codevs 3134)