Online MIPT programming contest | РУССКИЙ |
<PREV Problem: | NEXT> |
< |
---|
Time limit = 1 second
Chess association decided to assign new phone numbers to all the members. The new numbers should be produced with a knight's move on a phone keypad. 0 and 8 are not valid leading digits. For instance, the number 340-49-27 matches the criteria.7 | 8 | 9 |
4 | 5 | 6 |
1 | 2 | 3 |
0 |
Create a program that computes the number of different phone numbers with a length N.
Input Integer N ( 1 ≤ N ≤ 100 )
Output Number of valid phone numbers
Input#12 |
Output#116 |
Author:
Peculiarities of national computer science problems
2000
© acm.mipt DevGroup The page was generated in 180ms |