Computers and Technology
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

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 02:00, sabrinarasull1pe6s61
Which of the following is a way the operating system prevents unknown or unauthorized users from accessing the system?
Answers: 2
image
Computers and Technology, 23.06.2019 02:50, bfell92
There’s only one game mode that stars with the letter β€˜e’ in cs: go. which of the options below is it?
Answers: 1
image
Computers and Technology, 23.06.2019 17:00, osirisarellane3792
*! 20 points! *jeff wants to create a website with interactive and dynamic content. which programming language will he use? a. dhtml b. html c. css d. javascript
Answers: 1
image
Computers and Technology, 24.06.2019 07:20, stephanieyingepbtcf8
3pointsyou've found an image you want to insert into your slide presentation. youwant to make the image look more gray so that it looks like an older imagewhat would you need to adjust? 0.00o a. sizeo b. hueo c. contrasto d. tones
Answers: 2
Do you know the correct answer?
Problem # 1651 GRAF on Pbinfo Requirement
The list of edges of a weighted undirected graph is...

Questions in other subjects:

Konu
English, 26.01.2021 22:00
Konu
History, 26.01.2021 22:00
Konu
History, 26.01.2021 22:00