Interest degree of vertices

Problem Name:
Interest degree of vertices
Site:HackerEarth
Links:
Tags:
Problem setters: