Warren and Stock Trading
CodeChefOpen on judge ↗
Warren has recently started to trade stocks. Since he is new to the game, he needs your help. On a particular day, a stock has an opening price and a closing price. Both of these are integers. The gradient of a stock is defined as the ratio of the closing price to the opening price. Gradient can be a non-integer number. For each x, such that a ≤ x ≤ b, and each y such that c ≤ y ≤ d, there exists
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