[Solution] Circular Track CodeChef Solution | CodeChef Problem Solution 2022
There is a circular track of length consisting of checkpoints and bidirectional roads such that each road has a length of unit.
Chef is currently at checkpoint and wants to reach checkpoint . Find the minimum length of the road he needs to travel.
Solution Click Below:- CLICK HERE
Input Format
- First line will contain , the number of test cases. Then the test cases follow.
- Each test case contains a single line of input, three integers and - the initial checkpoint, the final checkpoint, and the total number of checkpoints respectively.
Output Format
For each test case, output the minimum length Chef needs to travel.
Constraints
Join Now for Solution:-
No comments:
Post a Comment