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

41/70

Solve/Submission

Ranking

# User Language Timing
01 njrafi Cpp14 0.00s
02 Rajib_119 Cpp14 0.00s
03 sayedgkm Cpp14 0.00s
04 Protap_Ghose Cpp14 0.00s
05 dip_BRUR Cpp14 0.00s
06 feodorv C 0.00s
07 seyedssz Cpp14 0.00s
08 ovis96 Cpp14 0.00s
09 Morass Cpp14 0.00s
10 Salty_Coder Cpp14 0.01s
11 lightlessShadO Cpp14 0.01s
12 rajdipsaha Cpp 0.01s
13 dmehrab06 Cpp14 0.01s
14 Jisancse Cpp 0.02s
15 sakib_muhit Cpp14 0.03s
16 Shadab Cpp14 0.17s
17 Zeronfinity Cpp14 0.26s
18 ImagineWarrior Cpp14 0.38s
19 jayanto Cpp14 0.39s
20 tariqiitju Cpp14 0.39s
21 sazal_dev Cpp14 0.39s
22 tareq_7 Cpp14 0.39s
23 clcrr Cpp14 0.39s
24 Mahmudul_Tushar Cpp14 0.40s
25 INUA Cpp14 0.40s
26 as_couple Cpp14 0.40s
27 akazad_cse13_ruet Cpp14 0.48s
28 musa Cpp14 0.49s
29 spy19 Cpp14 0.50s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support