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 1.00
C++ 1.00
C++14 1.00
C# 2.00
Go 2.00
Java 2.00
JavaScript 2.00
Objective-C 2.00
Perl 2.00
PHP 2.00
Python 2.00
Python3 2.00
Ruby 2.00
VB.Net 2.00

Problem Stats

64/113

Solve/Submission

Ranking

# User Language Timing
01 sayedgkm Cpp14 0.00s
02 Rajib_119 Cpp14 0.00s
03 dip_BRUR Cpp14 0.00s
04 njrafi Cpp14 0.00s
05 ovis96 Cpp14 0.00s
06 Protap_Ghose Cpp14 0.00s
07 seyedssz Cpp14 0.00s
08 Morass Cpp14 0.00s
09 Tahmid Cpp14 0.00s
10 SakibAlamin Cpp14 0.00s
11 mpnri Cpp 0.00s
12 feodorv C 0.00s
13 sdpsarker88 Cpp 0.00s
14 Robbinb1993 Cpp 0.00s
15 Shourov Cpp 0.00s
16 Ishrak Cpp 0.01s
17 robin_aust Cpp 0.01s
18 prodipdatta7 Cpp14 0.01s
19 rajdipsaha Cpp 0.01s
20 rohijulislam Cpp14 0.01s
21 AlirezaNa Cpp 0.01s
22 Salty_Coder Cpp14 0.01s
23 dmehrab06 Cpp14 0.01s
24 _dipu Cpp14 0.01s
25 Jisancse Cpp 0.02s
26 haasib Cpp 0.03s
27 acraider Cpp14 0.03s
28 sakib_muhit Cpp14 0.03s
29 rummanrakib11 Cpp 0.04s
30 Shadab Cpp14 0.17s
31 Zeronfinity Cpp14 0.26s
32 ImagineWarrior Cpp14 0.38s
33 jayanto Cpp14 0.39s
34 clcrr Cpp14 0.39s
35 tariqiitju Cpp14 0.39s
36 sazal_dev Cpp14 0.39s
37 tareq_7 Cpp14 0.39s
38 INUA Cpp14 0.40s
39 Mahmudul_Tushar Cpp14 0.40s
40 as_couple Cpp14 0.40s
41 akazad_cse13_ruet Cpp14 0.48s
42 musa Cpp14 0.49s
43 spy19 Cpp14 0.50s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support