P05
CodeChefOpen on judge ↗
Given 2 int values greater than 0, return whichever value is nearest to 51 without going over. Return 0 if they both go over. (49, 51) → 51 (21, 50) → 50 (49, 42) → 49 Example Input: 19 22 Output: 19
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