$nominals = [1,2,5,10,20,50,100];
$productCost = 30;
// вывести 30, 40, 50, 100;
$productCost = 312;
// вывести 312,315,320,350
coins = [1, 2, 5, 10, 20, 50, 100]
def roundup(cost):
return sorted(set((cost + c - 1) // c * c for c in coins))
print(roundup(30)) # [30, 40, 50, 100]
print(roundup(312)) # [312, 315, 320, 350, 400]