Bangalore To Surat
CodeChefOpen on judge ↗
DJ is a Gujarati man. Always tries to save his money. One day, he wants to go from city Bangalore to city Surat (Home Town). Between Bangalore and Surat, there are N number of cities(including Surat and excluding Bangalore) and in each city, there are M trains numbered from 1 to M. And the fare of each train is different. Means for all N*M trains, fare (K) may be different or same. Now DJ has to
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