Блог пользователя returnA

Автор returnA, история, 15 месяцев назад, По-английски

 Keval has forgotten the password to his I-Pad. The password is a 4-digit number where each digit takes a value from 0 to 9. The good thing is that Keval remembers that his password had exactly two unique digits, and each of these digits appeared exactly twice in the password. Keval also remembers that n digits (where, 0 ≤ n ≤ 10) from 0-9 were definitely not used in the password.

Find the number of different possible passwords Keval could have. Note that the password can start with the digit 0

Input constraints 0 ≤ n ≤ 10

Input format The only line of input contains a single integer n, the number of digits which were not used in the password.

Output Format Output a single integer that denotes the number of possible password sequences.

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
15 месяцев назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

c(10-n,2)*c(4,2)

cause you must choose 2 of 10-n valid digit for password and they have c(4,2) permutation