Gardener-painter

Gardener has to paint trees after planting. He has paint of three colour: white, blue and orange.
How many ways he can paint of N trees, if not any two the same colours can be side by side?
Specifications
Input
The quantity of trees is N (1 ≤ N ≤ 50).
Output
The quantity of ways of paint.
Problem information
Time Limit: 1 secondsMemory Limit: 64 MB
Balls for the passed test: 10
Complexity: 19% 679/836
Example
Example input3 |
Example output12 |
| ← Dragon | Problems | Paint2D → |
