subject

Problema #1651 GRAF de pe Pbinfo Cerința
Se dă lista muchiilor unui graf neorientat ponderat. Să se determine vârful pentru care media aritmetică a ponderilor muchiilor incidente este minimă. Dacă există mai multe vârfuri cu aceeași medie minimă, se va afișa vârful numerotat cu o valoare mai mică.

Date de intrare
Programul citește de la tastatură numerele n m, reprezentând numărul de vârfuri și numărul de muchii din graf, apoi m triplete i j p, reprezentând muchiile, date prin extremități și pondere.

Date de ieșire
Programul va afișa pe ecran numărul vf, reprezentând vârful determinat.

Restricții și precizări
1 ≤ n ≤ 100
ponderile muchiilor sunt numere naturale nenule mai mici decât 1000
Exemplu
Intrare

5 6
1 2 10
2 3 2
2 5 2
3 5 12
3 4 1
4 5 5
Ieșire

4
Explicație
Mediile ponderilor muchiilor incidente cu vârfurile grafului sunt:

pentru vârful 1 media este 10
pentru vârful 2 media este 4.66667
pentru vârful 3 media este 5
pentru vârful 4 media este 3
pentru vârful 5 media este 6.33333
Astfel media minimă este 3, pentru vârful 4

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 22:50
An environmental protection agency study of 12 automobiles revealed a correlation of 0.47 between engine size and emissions. at 0.01 significance level, can we conclude that there is a positive association between the variables? what is the p value? interpret.
Answers: 2
question
Computers and Technology, 24.06.2019 03:00
Will do anything for brainlest so can you guys me out i will try my best to you out
Answers: 1
question
Computers and Technology, 24.06.2019 14:00
Which describes careers that have similar education requirements but different qualifications? product safety engineers and materials engineers industrial safety engineers and industrial health engineers quality control systems managers and inspectors industrial safety and health engineers and hand packers
Answers: 3
question
Computers and Technology, 25.06.2019 01:30
What controls can be found on the file tab of microsoft word
Answers: 1
You know the right answer?
Problema #1651 GRAF de pe Pbinfo Cerința
Se dă lista muchiilor unui graf neorientat ponderat....
Questions
question
Chemistry, 18.09.2019 17:30