Google Code Jam 2021 Round 1C Problem 1

In this Google Code Jam 2021 Round 1C problem 1 the expected solution in my sense to the test case below is:
8/18, i.e.,
0.4444444444
but the actual output is:
0.555555556

Could someone please explain why the actual output is not same as what i expect.

Test Case:
input:
5 18
17 4 4 18 6
output:
0.555555556

PS: This is my solution, which is also incorrect.

Thats because the ans is 10/16. We will be picking the numbers 5 and 16.

Sorry 10/18.

if we pick 5 and 16 then the output will be (1 + 5)/18. won’t it?

So we pick 3 and 16 or 7, which gives output (3 + 5)/18.

if we pick 7 and 16 they cover the enitre range of 7 and 16. i.e 7,8,9,10…16 i.e 10 numbers.

Thanks much!