subject
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

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 05:20
Which operating system is a version of linux?
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
To produce a starlight effect in her photograph, lina should choose the filter for her camera.
Answers: 1
question
Computers and Technology, 24.06.2019 02:10
Which sentences describe the things you need to ensure while creating a sketch and a drawing? while an artistic or creative drawing is a creative expression, a technical drawing is an informative expression. you need to create accurate and neat drawings to convey accurate information. a technical drawing clearly conveys its meaning or information, and does not leave room for interpretation maintain a good speed while creating drawings
Answers: 1
question
Computers and Technology, 24.06.2019 08:00
Arah has entered data about football players from team a and team b in a worksheet. she enters names of players from team a with details about each player in different columns of the worksheet. similarly, she enters details of all the players from team b. which option will her view the data for team a and team b in two separate sections after printing? a. page break view b. freeze pane view c. split screen view d. full screen view e. zoom out view
Answers: 1
You know the right answer?
Problem # 1651 GRAF on Pbinfo Requirement
The list of edges of a weighted undirected graph is...
Questions
question
Chemistry, 18.10.2019 11:50
question
Mathematics, 18.10.2019 12:00
Questions on the website: 13722362