codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

630H.md (1016B)


      1 Source: https://codeforces.com/problemset/problem/630/H
      2 
      3 H. Benches
      4 
      5 time limit per test
      6 
      7 0.5 seconds
      8 
      9 memory limit per test
     10 
     11 64 megabytes
     12 
     13 input
     14 
     15 standard input
     16 
     17 output
     18 
     19 standard output
     20 
     21 The city park of IT City contains *n* east to west paths and *n* north to south paths. Each east to west path crosses each north to south path, so there are *n*2 intersections.
     22 
     23 The city funded purchase of five benches. To make it seems that there are many benches it was decided to place them on as many paths as possible. Obviously this requirement is satisfied by the following scheme: each bench is placed on a cross of paths and each path contains not more than one bench.
     24 
     25 Help the park administration count the number of ways to place the benches.
     26 
     27 Input
     28 
     29 The only line of the input contains one integer *n* (5 ≤ *n* ≤ 100) — the number of east to west paths and north to south paths.
     30 
     31 Output
     32 
     33 Output one integer — the number of ways to place the benches.
     34 
     35 Examples
     36 
     37 Input
     38 
     39 ```
     40 5
     41 ```
     42 
     43 Output
     44 
     45 ```
     46 120
     47 ```