DCP-11: Product Owner’s Problem Back to All Problems

Hard Divide and Conquer > Dynamic Programming


Any product owner (PO) of a company feels that being the PO is a very difficult job. More than coding, managing the programmers and distributing the tasks between various programmers prove to be a tiring task. There are many tasks to be completed and he has a team of talented programmers to do this for him. But the PO always has a problem distributing tasks among them. For a programmer i, the PO wants to give him ***at least*** Xi tasks to complete in a day. But different programmers have different capacities. Any programmer i can do ***at most*** Yi number of tasks in a single day. PO is very aware of every programmer's capability and will not give anyone more work than his maximum capacity. Now he needs your help to tell him the number of ways in which he can distribute the given number of tasks among his team. Input: ------ First line contains T (<=60), number of test cases. Then, each test case begins with a single line containing two space separated integers: N (***number of tasks to be completed***) and M (***number of programmers in his team***). **1 <= N, M <= 100 and 0 <= Xi, Yi <= 100** Then follow M lines. The ith line contains two integers which are the corresponding Xi and Yi. Output: ------- For each test case, print the case number followed by the number of ways of distributing the tasks mod **1000000007**. Sample Input ------------ 2 3 2 0 3 1 3 5 3 0 2 1 3 2 3 Sample Output ------------- Case 1: 3 Case 2: 5


Problem Setter:

Rezwanul Islam Maruf

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C/C++ 1.00
Java 2.00
C# 2.00
PHP 2.00

Problem Stats

25/42

Solve/Submission

Ranking

# User Language Timing
01 Protap_Ghose Cpp 0.00s
02 sayedgkm Cpp 0.00s
03 Salty_Coder Cpp 0.01s
04 Shadab Cpp 0.17s
05 Zeronfinity Cpp 0.26s
06 ImagineWarrior Cpp 0.38s
07 jayanto Cpp 0.39s
08 clcrr Cpp 0.39s
09 tariqiitju Cpp 0.39s
10 sazal_dev Cpp 0.39s
11 tareq_7 Cpp 0.39s
12 INUA Cpp 0.40s
13 Mahmudul_Tushar Cpp 0.40s
14 as_couple Cpp 0.40s
15 akazad_cse13_ruet Cpp 0.48s
16 musa Cpp 0.49s
17 spy19 Cpp 0.50s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support