Given n students that are connected by edges. We have to find the maxiumum number of answers that can be passed.
An answer is said to be passed if it reaches every student.
There are 3 constraints:-
- You can give only one answer to a particular student.
- Student who recieved the answer directly from you, can share it with thier immediate neigbours.
- Student who recvied the answer indirectly (not from you) cannot share it with anyone.
So we have to find the maxiumum number of answer that can be passed.
for example:
n = 3
1 — 2
2 — 3
ans1 can be given to student no 2, so he can pass it to student 1 and 3.
ans2 can be given to student 1 and 3 so they can pass it to student 3.
In both of the cases answer reaches all the students and you haven't given more than one answer directly to any student.
So the answer will be 2
Constraints:
n <=15




