In the mystical realm of Graphlandia, each city is represented by a node in a vast network of roads, forming a graph. Each city is infused with a magical energy level, attracting adventurers from all corners of the world. As an adventurer, your task is to determine how many cities you can explore starting from each city, with the constraint that you may only travel to cities with an energy level less than or equal to the starting city's level.
The challenge is to calculate, for each city, the number of cities that can be reached under these conditions.
The first line contains two integers $$$N$$$ and $$$M$$$ ($$$1 \leq N \leq 10^6$$$, $$$0 \leq M \leq 10^6$$$), representing the number of cities (nodes) and the number of roads (edges) respectively.
The second line contains $$$N$$$ integers $$$e_1, e_2, \ldots, e_N$$$ ($$$1 \leq e_i \leq 10^6$$$), where $$$e_i$$$ is the energy level of city $$$i$$$.
The next $$$M$$$ lines each contain two integers $$$u$$$ and $$$v$$$ ($$$1 \leq u, v \leq N$$$, $$$u \neq v$$$), representing a bidirectional road between cities $$$u$$$ and $$$v$$$. Each pair of cities is connected by at most one road.
Output $$$N$$$ lines, each containing a single integer. The $$$i$$$-th line should contain the number of cities that can be visited starting from city $$$i$$$, following the movement rules.
6 51 5 7 11 10 91 21 31 44 54 6
1 2 3 6 1 1
3 31 2 31 22 33 1
1 2 3
5 78 3 6 10 91 22 31 33 41 44 51 5
3 1 2 5 4