All submissions for this problem are available.Mr. Mathews daughter Julie is going to get married on February $14$th $2020$. He has decided for a function of at most $5$ days. He has arranged $K$ number of hotel rooms to accommodate his guests. He has strange guests, who are going to attend and depart the marriage party on different days. To save money, Mr. Mathew has thought of an accommodation plan to arrange $N$ number of guests in $K$ rooms in such a way that his savings will be maximum. Help him to save money through your code.($N>=K$) ###TERM DEFINING $A$i, $D$i denotes the arriving days($ \leq 5$) and the leaving/departing days($ \leq 5$) for the guests. ###INPUT -First line of the input includes total number of test cases $T$. -Next line has input $K$, the total number of rooms. -Next $K$ inputs, denote the price of the room. -Next input include $N$. -Next $N$ input, denote the arrival days $A$i. -Next $N$ input, denote the departure days $D$i. ###OUTPUT A single integer denoting the minimum amount $P$ required to accommodate everyone. ###CONDITION:- -Price is only paid when guests arrive on one day and depart on another day. Same day arrival and departure costs no money according to hotel booking authorities. -The function is arranged only for $5$ days hence $A$i and $D$i should be less than $5$. -Rooms can be interchanged to accommodate guests in a room of minimum rate. ###Sample Input 2 5 100 200 150 250 300 8 1 5 3 4 2 1 5 3 2 5 5 5 4 3 5 4 6 250 639 245 789 120 368 8 1 5 3 2 1 4 5 3 4 5 5 4 2 5 5 4 ###Sample Output 1200 2078
|Time Limit:||0.1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.