Rhezo and Cinema Hall
Practice
4 (80 votes)
Combinatorics
Data structures
Dynamic programming
Easy
Two dimensional
Problem
20% Success 1403 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Rhezo is the new manager of Specialist Cinema Hall. A new movie is being released this Friday and Rhezo wants people in the hall to be seated according to some rules. His rules are weird and he likes that no 2 people in a row sit together/adjacent. He also wants that there are at least 2 people in each row.

The hall should have at least K people in it, if there are less the show gets cancelled. The hall can be visualised as a \(N \times M\) matrix. Rhezo wants to find the number of different seating arrangements of people in it. Two seating arrangements are different if there is at least one seat which is filled in one arrangement and vacant in other.

You being Rhezo's best friend, want to help him in this task. As the number can be large, output your answer modulo \(10^9+7\).

Input:

First line of input contains 2 integers N and M. Second line contains a single integer K.

Output:

Find the number of different arrangements of people in the hall satisfying the constraints given in problem statement. Output your answer modulo \(10^9+7\).

Constraints:

\(1 \le N, K \le 500\)

\(1 \le M \le 10\)

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
63 votes
Tags:
Dynamic ProgrammingEasyOpenTwo dimensional
Points:30
5 votes
Tags:
CombinatoricsDynamic ProgrammingEasy
Points:30
30 votes
Tags:
AlgorithmsDynamic ProgrammingEasyTwo dimensional簡単-普通