This page is still under construction.

Parts of this page are still being built. What you see may change.

Placement of Keys

Time limit1sMemory limit128 MB

Summary
Count the key placements that open all boxes after forcing open the first two, for each n up to 200.
Level

Medium6 of 10

Topics
Combinatorics, Math
Solved
No attempts yet

Problem

There are nn boxes A1,A2,…,AnA_1, A_2, \dots, A_n with 3≤n≤2003 \le n \le 200, and every box has its own lock. No two locks are alike. Put the nn keys that open these locks into the nn boxes, one key per box, then lock every box.

Now force open A1A_1 and A2A_2 and take out the keys inside. If one of those keys opens a locked box, open it and take out the key inside to unlock another box. Repeat until no further box can be opened.

If all nn boxes end up open, the arrangement of the keys is called a good placement. How many different good placements are there?

Input

The input holds several data, one integer nn per line. The last line holds −1-1, which marks the end of the input and is not a datum.

Output

For each datum print two lines. The first line is N=, then the given nn, then a colon. The second line is the number of good placements.

Examples1

  1. Example 1

    Input
    6
    8
    -1
    
    Expected output
    N=6:
    240
    N=8:
    10080