output_description: Find the minimum number of edges that need to be removed.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N M
      X_1 X_2 ... X_N
      A_1 B_1 Y_1
      A_2 B_2 Y_2
      :
      A_M B_M Y_M
attempt: giveup
  
problem_description: Statement
  
  There is a connected undirected graph with N vertices and M edges. The
  vertices are numbered 1 to N, and the edges are numbered 1 to M. Also, each of
  these vertices and edges has a specified weight. Vertex i has a weight of X_i;
  Edge i has a weight of Y_i and connects Vertex A_i and B_i.
  
  We would like to remove zero or more edges so that the following condition is
  satisfied:
  
    * For each edge that is not removed, the sum of the weights of the vertices in the connected component containing that edge, is greater than or equal to the weight of that edge.
  
  Find the minimum number of edges that need to be removed.
samples: [{"input": "4 4\n    2 3 5 7\n    1 2 7\n    1 3 9\n    2 3 12\n    3 4 18", "output": "2\n    \n\nAssume that we removed Edge 3 and 4. In this case, the connected component\ncontaining Edge 1 contains Vertex 1, 2 and 3, and the sum of the weights of\nthese vertices is 2+3+5=10. The weight of Edge 1 is 7, so the condition is\nsatisfied for Edge 1. Similarly, it can be seen that the condition is also\nsatisfied for Edge 2. Thus, a graph satisfying the condition can be obtained\nby removing two edges.\n\nThe condition cannot be satisfied by removing one or less edges, so the answer\nis 2.\n\n* * *"}, {"input": "6 10\n    4 4 1 1 1 7\n    3 5 19\n    2 5 20\n    4 5 8\n    1 6 16\n    2 3 9\n    3 6 16\n    3 4 1\n    2 6 20\n    2 4 19\n    1 2 9", "output": "4\n    \n\n* * *"}, {"input": "10 9\n    81 16 73 7 2 61 86 38 90 28\n    6 8 725\n    3 10 12\n    1 4 558\n    4 9 615\n    5 6 942\n    8 9 918\n    2 7 720\n    4 7 292\n    7 10 414", "output": "8"}]