LGIC - LOGIC

Given a sequance of natural numbers.

Find N'th term of this sequence.

a1=2, a2=4, a3=11, a4=36, a5=147, a6=778 ... ... ... ... aN.

Input

 

Only one natural number 7<=N<20.

Output

One natural number. N'th term of the sequence.

Example

Input:
10
Output:
3629814

Added by:Azat Taryhchiyev
Date:2012-02-15
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All
Resource:KG Regional Contest

hide comments
2015-01-21 02:20:45 Syed Sarfaraz Akhtar
very weak test cases...
2015-01-21 02:20:45 Rishwanth
AC in first attempt.. my first in python.. :D
2015-01-21 02:20:45 Vaibhav Yenamandra
Ruby, 2 lines :)
2015-01-21 02:20:45 (Tjandra Satria Gunawan)(曾毅昆)
solved using brainf**k ;-)
2015-01-21 02:20:45 Francky
This is a 'riddle' problem. Moved.
2015-01-21 02:20:45 shiva_hellgeek
Is the limit really-
n<=10^18????
then how is it possible that the answer can be stored in lld????
:p
:p
:p
2015-01-21 02:20:45 Himanshu
a(N)<=10^18
question is misguiding......
ah.. ac in 1st attempt
2015-01-21 02:20:45 @looser@
only 5 line code in python
2015-01-21 02:20:45 Ikhaduri
This problem has the most pathetic test cases I have ever encountered. Plus constraints are misleading and big integer arithmetic isn't needed.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.