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
sky_10: 2020-08-16 22:16:51

AC in one go!

ameybhavsar: 2020-07-31 14:48:37

3629814 is very close to 3628800 or 10!

dwzy: 2018-12-22 16:05:37

???????????

ansisg: 2018-09-08 12:28:52

its about factorials, but with weird offset.
Werry good task.

Last edit: 2018-09-08 12:32:04
mynk322: 2018-08-20 19:28:41

donno but I think it's something to do with factorial......... ;-)

mynk322: 2018-08-20 19:27:20

AC in 1 go!!!!

neverhopeless: 2018-07-16 13:33:04

@sharad mahajan, thanks :)

imkiller: 2018-06-07 17:22:45

Tricky One
PythonRocks

sas1905: 2016-11-13 11:41:22

3 lines of code ..akt rocks

e869120: 2016-08-05 12:54:15

Interesting problem.
This problem is not bug funny.
Implementation is very easy. 255B in C++.
[This number of bytes is not exceed unsigned char maximum number :-) ]


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