def catlan(n):
i=2*n
j=1
ans=1
while j<=n:
ans*=i
ans//=j
i-=1
j+=1
ans//=n+1
return ans
b=[None]*27
def supcat(n):
if n<3:
return 1;
if b[n] is not None:
return b[n]
b[n]=(3*(2*n-3)*supcat(n-1)-(n-3)*supcat(n-2))//n
return b[n]
def Main():
while True:
try:
a=int(input())
print(supcat(a)-catlan(a-1))
except EOFError:
return 0
if __name__=='__main__':
Main()
i=2*n
j=1
ans=1
while j<=n:
ans*=i
ans//=j
i-=1
j+=1
ans//=n+1
return ans
b=[None]*27
def supcat(n):
if n<3:
return 1;
if b[n] is not None:
return b[n]
b[n]=(3*(2*n-3)*supcat(n-1)-(n-3)*supcat(n-2))//n
return b[n]
def Main():
while True:
try:
a=int(input())
print(supcat(a)-catlan(a-1))
except EOFError:
return 0
if __name__=='__main__':
Main()
Comments
Post a Comment