TPSYRZWZFZMYZDKRQU6GEAOGK7X7YEQ2Q2C4NEEWPWXQ4VXUOECQC
// Package summultiples is for reporting multiples.
package summultiples
// SumMultiples sums up every multiple of each element in div once.
func SumMultiples(limit int, div ...int) int {
var sum int
for i := 1; i < limit; i++ {
for _, d := range div {
if d == 0 {
continue
}
if i%d == 0 {
sum += i
// do not count more than once
break
}
}
}
return sum
}