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

37/77

Solve/Submission

Ranking

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

Your feedback is our precious!



Or call +88 02 9853138 for support