PAPARAZZI GENNADY 100 POINT FULL SOLUTION IN C++ : • PAPARAZZI GANNADY || 100 Point Confirm || ...
College Life 4 Full 100 Point Solution : • COLLEGE LIFE 4 || 100 POINT CONFIRM || Cod...
Interesting Xor 100 Point Optimized : • Interesting XOR Optimized Solution || 100 ...
College Life 4 Loop Based Solution : • College Life 4 Loop Bases Solution
Space Arrays : • Space Arrays || 100 Point || SPACEARR || ...
College Life 4 Greedy Approach : • College Life 4 Greedy Approach | Full Solu...
College Life 4 : • College Life 4 || COLGLF4 || Codechef Marc...
SPACE ARRAYS : • SPACE ARRAYS || SPACEARR || Codechef long ...
Interesting Xor : • Interesting Xor || IRSTXOR || Full Solutio...
Chef And Groups : • Chef And Groups || Codechef Long Challenge...
No Time To Wait : • No Time To Wait || Approach, Idea, Code wi...
March Long Challenge 2021 Solution Full Playlist : • MARCH LONG CHALLENGE 2021 😍😍😍
COLGLF4
College Life 4 Loop Bases Solution
College Life 4
Here Total N friend goes into the canteen
And they have to order N item for eat
here Given Constraint's are
A = Price of Omelette
B = Price of Chocolate Milkshake
C = Price of Chocolate Cake
and two other
H = no. of chocolate bars present in the Canteen
E = No. of eggs presents in the canteen
here we have to find with given different constraint we have to
print minimum cost for placing exact N order or
print -1 for the if it is not possible to make exact N item with the given constraint
LET's SEE and observe by given test cases value
here we have to note one other thing this is that
for making a
Omellete we have 2 Eggs Required
Chocolate milkshake 3 Chocolate Bar
chocolate cake 1 eggs + 1 chocolate bar
so let's see test cases for given first cases
Here we have to use a DP (Dynamic Programin) Concept for solving this question
for given test cases
N = 5
E = 4
H = 4
A = 2
B = 2
C = 2
we have to make total 5 item
but here only 4 eggs & 4 chocolate bars are present
so for that we have no any choices to make any way 5 things as required so
output for this test case is -1
WE HAVE TO USE DP(Dynamic Programin Concept to solve this question)
For second Test Cases :
N = 4
E = 5
H = 5
A = 1
B = 2
C = 3
so for this test cases this is possible to make a total 4 order but
we have to minimise the spend of this N friend so we have to go for optimization
here we thought go through
3 For loop but this is give TLE
so we have to use must here DP
Learn about DP next Video With Code Coming Soon For This Question
as submission increase for this question
because if
this time solution with code come then it give all copy issue
so think your way and next video with code in C++ solution for this question
Coming Soon
SUBSCRIBE CHANNEL
KEEP LEARNING :)
Input :
3
5 4 4 2 2 2
4 5 5 1 2 3
4 5 5 3 2 1
Output
-1
7
4
KEEP LEARNING
KEEP CODING
HAPPY CODING :)))))))
THANK YOU