Construct a Tree whose sum of nodes of any path is not divisible by the count of nodes in that path

  
#include
using namespace std;
  

void assignValues(int Edges[][2], int n)
{
    
    vector tree[n + 1];
  
    
    for (int i = 0; i < n - 1; i++) {            int u = Edges[i][0];         int v = Edges[i][1];         tree[u].push_back(v);         tree[v].push_back(u);     }                  vector visited(n + 1, false);             vector answer(n + 1);                       int K = 1;             queue q;             q.push(1);             answer[1] = K;        while (!q.empty()) {                     int node = q.front();         q.pop();                     visited[node] = true;                     K = ((answer[node] == 1) ? 2 : 1);                     for (auto child : tree[node]) {                             if (!visited[child]) {                                     q.push(child);                                     answer[child] = K;             }         }     }                  for (int i = 1; i