Chef And Favorite Color
CodeChefOpen on judge ↗
Chef has two favorite colors $X$ and $Y$. 1 unit of Color $X$ is made by combining $A$ units of color $x1$ and $B$ units of color $y1$ whereas 1 unit of Color $Y$ is made by combining $A$ units of color $y1$ and $B$ units of color $x1$. Chef currently has $P$ units of color $x1$ and $Q$ units of color $y1$ with him and wants to combine them in such a manner so that he can obtain maximum units of h
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start