The call is ambiguous between the following methods or properties
Hey, i'm very new to C# and im getting this error "The call is ambiguous between the following methods or properties"
using System;
using System.Collections.Generic;
using System.Linq;
public class Test
{
public static void Main()
{
int[] input = {16,1,2,0,4,2,7,1,2,14};
int avg = (int)Math.Ceiling(input.Sum() / input.Length);
int min_pos = 2147483647;
for (int i = input.Min(); i <= avg; i++)
{
int pos = 0;
foreach (int num in input)
{
pos += Math.Abs(num - i);
}
min_pos = Math.Min(min_pos, pos);
}
int result = min_pos;
Console.WriteLine(result);
}
}/tmp/PKtP038Ijk.cs(11,23): error CS0121: The call is ambiguous between the following methods or properties: 'Math.Ceiling(decimal)' and 'Math.Ceiling(double)'Ceiling(int)Math.Ceiling((double)input.Sum() / input.Length)