Redirecting to
NADOS

New Year Tree

.

https://codeforces.com/contest/620/problem/E
Input Format
.
Output Format
.
Question Video
Constraints
.
Sample Input
7 10
1 1 1 1 1 1 1
1 2
1 3
1 4
3 5
3 6
3 7
1 3 2
2 1
1 4 3
2 1
1 2 5
2 1
1 6 4
2 1
2 2
2 3
Sample Output
2
3
4
5
1
2


  • Asked in Companies
  • Related Topics






Video Solution

Code Solution

Run
 
Run
Id Name