PROGRAMMING:Edge pruning of Graphs
Please write a program to delete some edges from the given digraph. A digraph contains n vertices, numbered from 0 to n-1.
###Input format:
Enter two positive integers n and E in the first line to represent the number of vertices and edges of the graph, where n does not exceed 20000 and E does not exceed 1000. Next, line e represents the information of each edge, and each line contains three non negative integers a, B, and C, where a and B represent the endpoint number of the edge, and C represents the weight. The sides are not arranged in end numbered order. The next line is an integer k, which indicates the number of edges to be deleted. The next line is k, each line has two non negative integers a and B, which indicates that the edge to be deleted is a - > B. Ensure that the deleted edge is in the original image.
###Output format:
Output the graph after edge pruning. Each line represents all the edges led out by a vertex, with the format of a: (a, B, w)..., indicating that the weight of a - > b is w, and the edges led out by a are arranged in the increasing order of number B. If a vertex has no leading edge, it is not output.
###Input example:
```in
7 7
0 1 5
0 3 7
0 6 6
1 2 4
2 5 1
3 5 3
6 5 4
two
2 5
0 1
```
###Output example:
```out
0:(0,3,7)(0,6,6)
1:(1,2,4)
3:(3,5,3)
6:(6,5,4)
```
answer:If there is no answer, please comment
###Input format:
Enter two positive integers n and E in the first line to represent the number of vertices and edges of the graph, where n does not exceed 20000 and E does not exceed 1000. Next, line e represents the information of each edge, and each line contains three non negative integers a, B, and C, where a and B represent the endpoint number of the edge, and C represents the weight. The sides are not arranged in end numbered order. The next line is an integer k, which indicates the number of edges to be deleted. The next line is k, each line has two non negative integers a and B, which indicates that the edge to be deleted is a - > B. Ensure that the deleted edge is in the original image.
###Output format:
Output the graph after edge pruning. Each line represents all the edges led out by a vertex, with the format of a: (a, B, w)..., indicating that the weight of a - > b is w, and the edges led out by a are arranged in the increasing order of number B. If a vertex has no leading edge, it is not output.
###Input example:
```in
7 7
0 1 5
0 3 7
0 6 6
1 2 4
2 5 1
3 5 3
6 5 4
two
2 5
0 1
```
###Output example:
```out
0:(0,3,7)(0,6,6)
1:(1,2,4)
3:(3,5,3)
6:(6,5,4)
```
answer:If there is no answer, please comment