The alphabet of a certain language consists of only three letters — a, o, and c. Determine the maximum number of words of length N that can exist in the language, if each letter of the alphabet can appear in a word no more than K times.
Two integers $$$N$$$ and $$$K$$$ are entered, each on a separate line ($$$1 \le N, K \le 30$$$).
Print a single integer — the number of words.
Subtask 1 (up to 25 points): $$$K \le 2$$$
Subtask 2 (up to 35 points): $$$N \le 15$$$
Subtask 3 (up to 40 points): $$$N \le 30$$$
2 1
6
2 2
9
In the first example, the answer is 6 — these are the words ao, oa, oc, co, ac, and ca. In the second example, the answer is 9, as it also includes the words aa, oo, and cc.
Note that the answer in the last subtask can be quite large and may not fit into a 32-bit data type. It is recommended to use a 64-bit data type, for example, the long long type in C++, the int64 type in Pascal, the long type in Java and C#. Python automatically works with integers of any length.
| Name |
|---|


