#K62342. Counting Valid Passwords

    ID: 31510 Type: Default 1000ms 256MiB

Counting Valid Passwords

Counting Valid Passwords

In this problem, you are given an integer (n) representing the length of a password. A valid password must satisfy the following conditions:

  1. The password must have length (n). If (n = 0), output 0.
  2. The password must begin with a letter (there are 26 possibilities).
  3. No two consecutive characters are of the same type. This means that after a letter, you must have a digit (10 possibilities), and after a digit, a letter (26 possibilities).

Thus, the number of valid passwords is calculated as follows:

  • If (n=0): (0).
  • If (n) is even, then the number of valid passwords is given by:

[ (26 \times 10)^{\frac{n}{2}} ]

  • If (n) is odd, then the number of valid passwords is:

[ 26 \times (26 \times 10)^{\lfloor\frac{n}{2}\rfloor} ]

Your task is to compute the number of valid passwords for a given (n) and print the result. Note that the result can be a very large number, so you must handle big integers appropriately in your solution.

inputFormat

The input consists of a single integer (n) ((0 \leq n \leq 1000)) from standard input.

outputFormat

Output a single line containing the number of valid passwords as described, printed to standard output.## sample

3
6760