import Data.List (group, sort) main = do [n, x] <- map read . words <$> getLine as <- group . sort . map (read :: String -> Int) . words <$> getLine print $ solve x $ take (x + 1) $ (++ (repeat 0)) $ f 0 as f _ [] = [] f i as | (head . head) as == i = (length . head) as : f (i + 1) (tail as) | otherwise = 0 : f (i + 1) as solve x as = g 0 where g i | i == x = 0 | otherwise = a1 * a2 + g (i + 1) where a1 = as !! i a2 = as !! (x - i)