func main() var n: int :: cui@inputInt() var k: int :: cui@inputInt() var a: []int :: #[n]int for i(0, n - 1) do a[i] :: cui@inputInt() end for var x: int :: 0 var md: int :: 0 for i(0, n - 1) do md :+ a[i] end for for i(0, n - 1) do x :* k do x :+ a[i] do x :% md end for var ans: int :: x do cui@print("\{ans}\n") end func