LGIC - LOGIC

no tags 

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

hide comments
dbz: 2015-01-21 02:20:45

all calculations comes in lld
whts the hell is this?????????
i got acc???????

dbz: 2015-01-21 02:20:45

question is misguiding

张翼德: 2015-01-21 02:20:45

The question sucks!!! Don't pay attention at the range :/

nikoo28: 2015-01-21 02:20:45

spending too much time on this problem will only confuse you further and further...
HINT: the large range of N is just an illusion... ;)

Pranshul Agarwal: 2015-01-21 02:20:45

Value of n is such that a(n)<=2^64 ;)

eliminator: 2015-01-21 02:20:45

7<=N<=65 ;)

Amit Gupta: 2015-01-21 02:20:45

weak testcases?

Ajey Golsangi: 2015-01-21 02:20:45

If N is 10^18, the output len is > (10^9) !!!

akb: 2015-01-21 02:20:45

how can some python function reduce time for a non O(lg n) function...

Shubham: 2015-01-21 02:20:45

I don't think it can be solved in sublinear time and the limits on N are certainly not correct.

Last edit: 2012-07-28 08:50:15

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