Ant Cakewalk
CodeChefOpen on judge ↗
An ant is caught on one corner of a cuboidal cake with sides l, b, and h. It wants to reach the diagonally opposite corner, However, the ant can perform a cakewalk only along the faces of the cake. What is the least amount of distance that the ant needs to walk to reach the other corner? Input There are T test cases. - First line contains a single integer, T. - T lines follow, each containing
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