Skip to main content
LIVE CONTEST: Round #7 · Begin Marathon is live now! …

~/algor $ cat problems/while/double-factorial-n

Double factorial (n!!)

Author Iqbolshoh Ilhomjonov 3 @iqbolshoh 650 problems
Easy 1000 ms 64 MB 23%
Share

A positive integer is given. Compute its double factorial :

The last factor is if is odd and if is even.

A chain of factors decreasing by two each time

Input

One integer .

Output

One integer — .

Note

Examples

Input #1
5
Output #1
15
Input #2
6
Output #2
48

Sign in to submit a solution

Signing up is free and takes a minute.