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

Problem Stats

42/98

Solve/Submission

Ranking

# User Language Timing
01 MAHRahat Cpp14 0.00s
02 emrul Cpp14 0.00s
03 tariqiitju Cpp 0.00s
04 SakibAlamin Cpp14 0.00s
05 Morass Cpp14 0.00s
06 feodorv C 0.00s
07 souravahmed C 0.00s
08 Robbinb1993 Cpp 0.00s
09 sk_roy Cpp14 0.01s
10 Sakib1061 Cpp 0.01s
11 shawon100 Cpp 0.01s
12 mahbub07 Cpp14 0.02s
13 RandyWaterhouse Python3 0.03s
14 smjlord068 Cpp14 0.28s
15 RakibR3 Cpp14 0.33s
16 Foyaz05 Cpp14 0.39s
17 Skyfall009 Cpp14 0.42s
18 moshiur_cse15 Cpp14 0.42s
19 imran16 Cpp14 0.47s
20 anowar1112 Cpp14 0.48s
21 Outrage Cpp14 0.48s
22 sajal_khan Cpp14 0.49s
23 rash29 Cpp14 0.51s
24 rajdipsaha Cpp14 0.51s
25 math10 Cpp14 0.52s
26 aniscseiu Cpp14 0.52s
27 alhelal_cse Cpp14 0.55s
28 sarafinmahtab Cpp14 0.55s
29 Mahmudul_Tushar Cpp14 0.56s
30 dmehrab06 Cpp14 0.61s
31 codehead Cpp14 0.62s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support