There are only 15 possible inputs, so if you're worried about your solution being too slow or if your solution **is** too slow, you can just precompute all answers and submit an O(1) solution. If your precomputation is so slow that it takes *minutes*, you can even let it run in the background while you're solving the next problem(s). Remember that your contest ranking doesn't depend on the *sum* of your problem times but on the *largest* one.

```
def countArrangement(self, N):
return (1, 2, 3, 8, 10, 36, 41, 132, 250, 700, 750, 4010, 4237, 10680, 24679)[N - 1]
```