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, 23.06.2019 06:10
The head restraint should be adjusted so that it reaches a.the top of your ears b.the base of your skull c.the top of the head
Answers: 1
Computers and Technology, 24.06.2019 12:30
Why does the pc send out a broadcast arp prior to sending the first ping request
Answers: 1
Computers and Technology, 24.06.2019 15:30
What is the total number of time zones that can be configured to show by default in a calendar in outlook 2016?
Answers: 1
Computers and Technology, 25.06.2019 05:00
What should you do if a dialog box covers an area of the screen that you need to see?
Answers: 1
Mathematics, 06.06.2021 15:00
Geography, 06.06.2021 15:00
Mathematics, 06.06.2021 15:00
Mathematics, 06.06.2021 15:00
English, 06.06.2021 15:00
Chemistry, 06.06.2021 15:00
English, 06.06.2021 15:00
Mathematics, 06.06.2021 15:00
Computers and Technology, 06.06.2021 15:00
Physics, 06.06.2021 15:00
Chemistry, 06.06.2021 15:00
Mathematics, 06.06.2021 15:00
Mathematics, 06.06.2021 15:00
Mathematics, 06.06.2021 15:00