SP32952 ADAFTBLL - Ada and Football
Description
Ada the Ladybug has many friends who live on a [tree](https://en.wikipedia.org/wiki/Tree_(data_structure)). Each of them is fan of a football team. Ada sometime go on a trip from one friend to another. If she meets a friend she tells him/her about all previously visited friends who are fans of the same team. The visited friend will gain **+1** happiness for each friend Ada told him/her about.
Ada is wondering (for each trip) what will be the total gaines happiness.
Also note that sometime a friend changes his/her mind and start to support different team.
Input Format
The first line two integers **1 , the number of friends (**N**) and the number of queries.**
The next line will contain **N** integers **0, the team which **i $ ^{th} $** friend supports.**
The next **N-1** lines will contain two integers **0 , the friends which will be connected by a branch (edge).**
The next **Q** lines will be of two kinds:
**1 x y** (**0 , **0 ), meaning that **x $ ^{th} $** friend will start supporting team **y** (instead of the old one).****
**2 a b** (**0 ), meaning that Ada will travel from friend **a** to friend **b** and wants to know the happiness.**
Output Format
For each query of second kind, output the gained happiness.