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




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

Your feedback is our precious!

Or call +88 02 9853138 for support