BEANONE - SEQUENCE

A sequence of natural numbers is given

A1=9
A2=96
A3=685
A4=4992
and so on..


Your task is to find the Nth term of the sequence.

Input

A natural number N such that 5<=N<=1000

Output

The Nth number of the sequence which is also a natural number.

Example

Input:
8
Output:
39916680

Added by:MR. BEAN
Date:2012-06-27
Time limit:0.100s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:ASM32-GCC MAWK BC C-CLANG C NCSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG COBOL COFFEE D-CLANG D-DMD DART ELIXIR FANTOM FORTH GOSU GRV JS-MONKEY JULIA KTLN NIM NODEJS OBJC OBJC-CLANG OCT PICO PROLOG PYPY PYPY3 PY_NBC R RACKET RUST CHICKEN SQLITE SWIFT UNLAMBDA VB.NET
Resource:Own Problem

hide comments
2016-09-09 19:52:58
seriously?? no mod??
2013-11-05 17:26:03 Sayak Chakraborti
Please see id:10425300 getting WA in judge(5)
2013-03-17 23:03:21 Francky
Moved to "riddle".
2012-09-03 04:58:57 Swapnil R.Mehta
Sir,
pls see id=7582799
getting WA.
thanks.:)
2012-08-24 14:13:34 Mostafa 36a2
Without Modulus ??!!!??!?!
2012-08-08 13:11:35 theChosenOne
Please provide some more test cases. I used perfect long number calculations with array and still getting WA.
2012-08-08 01:33:28 theChosenOne
Why am I getting WA even after using the correct pattern?
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.