Question
Either Solve Python or Java or C++ The Football World Cup has begun and we have the statistics on the average number of goals scored
Either Solve Python or Java or C++
The Football World Cup has begun and we have the statistics on the average number of goals scored by every game by every country that has qualified for the playoff(in the qualification phase). In the playoff, each team will lay the others exactly once. Assuming you can only watch one random game , your goal is to estimate the probability off watching the highest scoring game . We will assume that the total goals scored when two teams meet is the sum of the average goals per game they scored in the qualification phase
The input is an array of integers, where the its element represents the average number of goals per game scored by team I. The input array is represented as follow:
4 // this represents the array length
1 // -> average number of goals by team 0
3// -> average number of goals by team 1
4 // -> average number of goals by team 2
2// -> average number of goals by team 3
The output is the probability of watching the highest scoring game. Just truncate the result, so if the answer is 0.6666666, return 0.66, if 0 return 0.00 etc. You should not round the result.
For an input array[1,2,3,4,2], the goals that will be scored when team plays with team 3 is > 1+2 =3
Sample case
4
3
3
3
3
Sample output
1.00
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started