Problem link:- https://www.codechef.com/AUG19A/problems/CHGORAM
The author has mentioned:- “a1,a2,a3” lie on a line.
By this I assume , in the tree , any 3 nodes, in which there is a connection between a1 and a2, a2 and a3
Now, the confusing part is:- The same author mentions in the comment section that on that path (a1—a2----a3) each vertex should have a degree of atmost “2” .
Why is this thing not mentioned in the problem statement ?
In the same problem, testcase answer is :- (3,2,4) where node-‘2’ has a degree of ‘3’ (which is contradictory to what author said in the comments)
Now, I am really confused . Please tell me the correct and proper meaning of :- “a1,a2,a3” are in a line…
Update:- My query has been resolved… thanks to the community