import qualified Data.ByteString.Char8 as B
import Control.Monad (replicateM)

solve = sum . solve'
  where
    solve' [] = []
    solve' [_] = []
    solve' (x:xs) = sum (map (* x) xs) : solve' xs

main :: IO ()
main = do
    n <- getInt
    bs <- getInts n
    print $ solve bs
    

getInt :: IO Int
getInt = readLn

getInts :: Int -> IO [Int]
getInts n = take n . map read . words <$> getLine

getMatrix :: Int -> Int -> IO [[Int]]
getMatrix y x = replicateM y $ getInts x

getStr :: IO B.ByteString
getStr = B.getLine

