← All problemsSign in

Number of pencils

Today Chef is going to draw a picture with Pink and Orange colored pencils placed in two different boxes. He can select $P$ Pink pencils and $Q$ Orange pencils in a particular range. The range will be given as $R1 \leq P \leq R2$ and $R3 \leq Q \leq R4$. You have to tell that how many $P$ and $Q$ pencils can be selected such that $P/Q$ will be in the given ratio $A/B$, i.e find the number of or

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start