Max Heat
Kiteretsu goes to his Chemistry Lab to perform the perfect reaction. In his lab, he found $N$ reagents numbered $1$ to $N$. The $i^{th}$ reagent has two properties - $A_i$ and $B_i$. A reaction can be performed between the reagents $i$ and $j$ **only if** $A_i \leq j$. If a reaction is performed between reagents $i$ and $j$, $i \cdot j$ amount of heat is produced. Out of this, $D \cdot (B_i \op
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