Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Time table Arrangements Anju teaches Physics and Chemistry for P and C number of hours respectively. After teaching a particular subject for more than N

Time table Arrangements
Anju teaches Physics and Chemistry for P and C number of hours respectively. After teaching a particular subject for more than N number of hours continuously Anju gets exhausted and needs to switch to another subject.
So the Principal has decided to schedule the time table for Anju in such a way that she does not teach a given subject for more than N number of hours continuously.
The principal being weak in maths asks you to find out the maximum number of possible arrangements of hours in which Anju can teach a given subject for no more than N number of hours continuously.
Input format
First-line contains T the required number of test cases
- Next T lines contain Three space-separated integers P, C, and N respectively. Output format
For each test case, print the number of arrangements of hours in which Anju has not to teach a given subject for more than N number of hours continuously modulo 10^9+7.
Constraints
1<= T <=10
1<= N, M, K <=10^3
Note: If no arrangement is possible print 0.
Sample Input
2
112121
Sample output
21
Explanation
Testcase 1: The possible arrangements are PC and CP.
Testcase 2: The only possible arrangement is CPC. in cpp

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions

Question

1-4 How will MIS help my career?

Answered: 1 week ago