Tap here to switch tabs
Problem
Submissions

Problem: Count Number of Ways to Place Houses

med
30 min
Try to solve the Count Number of Ways to Place Houses problem.

Statement

You are given an integer n representing a street with n plots on each of its 22 sides, resulting in a total of 2imes2 imes n plots.

On each side of the street, you may place houses on the plots such that no 22 houses are placed on adjacent plots. A house placed on one side of the street does not affect the placement of houses on the other side.

Return the total number of possible house placements.

Note: Since the answer can be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 1≤1 \leq n ≤104\leq 10^4

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Number of Ways to Place Houses

med
30 min
Try to solve the Count Number of Ways to Place Houses problem.

Statement

You are given an integer n representing a street with n plots on each of its 22 sides, resulting in a total of 2imes2 imes n plots.

On each side of the street, you may place houses on the plots such that no 22 houses are placed on adjacent plots. A house placed on one side of the street does not affect the placement of houses on the other side.

Return the total number of possible house placements.

Note: Since the answer can be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 1≤1 \leq n ≤104\leq 10^4