Problem # 1651 GRAF on Pbinfo
Requirement
The list of edges of a weighted undirected graph is...
Computers and Technology, 21.01.2021 17:50 vDxrk
Problem # 1651 GRAF on Pbinfo
Requirement
The list of edges of a weighted undirected graph is given. Determine the peak for which the arithmetic mean of the weights of the incident edges is minimal. If there are several vertices with the same minimum average, the numbered vertex with a lower value will be displayed.
Input data
The program reads from the keyboard the numbers n m, representing the number of vertices and the number of edges in the graph, then m triplets i j p, representing the edges, given by extremities and weight.
Output data
The program will display the number vf on the screen, representing the determined peak.
Restrictions and clarifications
1 ≤ n ≤ 100
edge weights are nonzero natural numbers less than 1000
Example
entry
5 6
1 2 10
2 3 2
2 5 2
3 5 12
3 4 1
4 5 5
Exit
4
Explanation
The averages of the weights of the edges incident with the vertices are:
for peak 1 the average is 10
for the top 2 the average is 4.66667
for peak 3 the mean is 5
for peak 4 the mean is 3
for the top 5 the average is 6.33333
Thus the minimum average is 3, for the peak 4
Answers: 2
Computers and Technology, 22.06.2019 02:00, aredwolf2017
When jen is planning to upgrade to a monitor with a better resolution, what should she be looking for in the new monitor?
Answers: 1
Computers and Technology, 24.06.2019 00:50, sequoyaburke
Which player type acts on other players? a. killer b. achiever c. explorer d. socializer
Answers: 1
Computers and Technology, 24.06.2019 20:00, impura12713
Avirus enters a computer or network as code embedded in other software directly from another computer
Answers: 1
Mathematics, 04.12.2020 20:20
Mathematics, 04.12.2020 20:20
Mathematics, 04.12.2020 20:20
English, 04.12.2020 20:20
Mathematics, 04.12.2020 20:20
Biology, 04.12.2020 20:20
Social Studies, 04.12.2020 20:20
Mathematics, 04.12.2020 20:20