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




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

Your feedback is our precious!

Or call +88 02 9853138 for support