mt function to add and muliply vector's elements