CF BUDDY
← Problems·

1182A · Filling Shapes

1000 · dp, math

Problem: You have a given integer nn. Find the number of ways to fill all 3×n3 \times n tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap.

This picture describes when n=4n = 4. The left one is the shape and the right one is 3×n3 \times n tiles.

Input Format: The only line contains one integer nn (1n601 \le n \le 60) — the length.

Output Format: Print the number of ways to fill.

Note: In the first example, there are 44 possible cases of filling.

In the second example, you cannot fill the shapes in 3×13 \times 1 tiles.

Sample Cases

Case 1

Input

4

Output

4

Case 2

Input

1

Output

0

Similar problems

00:00:00
Loading editor…
Welcome! I'm your coding tutor for this problem. Use the chips below to reveal stored hints or get AI feedback on your code. I'll guide you step by step — never giving away the solution.

Sign in to unlock AI tutor feedback