DCP-62: HTTP Server Back to All Problems

Easy Beginners Problems > Ad-hoc


All of you must heard about HTTP (HyperText Transfer Protocol). One of my friend has a HTTP server, that means it can only response to the HTTP requests send by client. This server only gives the response to four types of requests – GET, POST, UPDATE, DELETE. Now the interesting thing about this server is, the response time using this four types of requests differs from phase to phase. That means if a request takes t sec to be responded in one phase of execution than it may take more or less than t sec in the next phase. On the beginning of each phase my friend calculates the time needed for each type of request to be responded. But he has failed to sort the requests in such an order thus in a particular phase the server can response to maximum number of requests. So, he has requested me to solve this problem. But as I'm little bit busy now-a-days, can you solve this problem for me? Input: ------ Input starts with an integer **T<=30**, denoting the number of test case or phase of execution. Each test case starts with four integers, the required times (1-10) in sec calculated by my friend on the beginning of the phase for responding GET, POST, UPDATE & DELETE requests respectively. Then there will be two integer **P <= 300 & R <= 50**. **P** denotes the duration of the phase in sec & **R** denotes the number of requests the server needs to response. The next **R** lines contain one of four types of request mentioned above. See the sample input output to get clear idea. Output: ------- For each test case print the case number & maximum number of request server can response in the phase. Sample Input ------------ 2 1 2 3 4 8 6 POST POST GET DELETE UPDATE GET 4 3 2 1 8 6 POST POST GET DELETE UPDATE GET Sample Output ------------- Case 1: 4 Case 2: 3


Problem Setter:

Golam Rahman Tushar

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C/C++ 3.00
Java 5.00
C# 5.00
PHP 5.00

Problem Stats

30/57

Solve/Submission

Ranking

# User Language Timing
01 mahrahat Cpp 0.00s
02 SakibAlamin Cpp 0.00s
03 sk_roy Cpp 0.01s
04 smjlord068 Cpp 0.28s
05 RakibR3 Cpp 0.33s
06 Foyaz05 Cpp 0.39s
07 Skyfall009 Cpp 0.42s
08 moshiur_cse15 Cpp 0.42s
09 imran16 Cpp 0.47s
10 Outrage Cpp 0.48s
11 anowar1112 Cpp 0.48s
12 sajal_khan Cpp 0.49s
13 rajdipsaha Cpp 0.51s
14 rash29 Cpp 0.51s
15 aniscseiu Cpp 0.52s
16 math10 Cpp 0.52s
17 sarafinmahtab Cpp 0.55s
18 alhelal_cse Cpp 0.55s
19 Mahmudul_Tushar Cpp 0.56s
20 dmehrab06 Cpp 0.61s
21 codehead Cpp 0.62s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support