#include <iostream>
#include <vector>
#include <iterator>
#include <numeric>
#include <functional>
int main()
{
std::vector<double> v{ 1.0, 2.0, 3.0, 4.0 };
std::partial_sum(std::begin(v), std::end(v),
std::begin(v), std::multiplies<double>());
std::copy(std::begin(v), std::end(v),
std::ostream_iterator<double>(std::cout, " "));
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8aXRlcmF0b3I+CiNpbmNsdWRlIDxudW1lcmljPgojaW5jbHVkZSA8ZnVuY3Rpb25hbD4KCmludCBtYWluKCkKewogICAgc3RkOjp2ZWN0b3I8ZG91YmxlPiB2eyAxLjAsIDIuMCwgMy4wLCA0LjAgfTsKCiAgICBzdGQ6OnBhcnRpYWxfc3VtKHN0ZDo6YmVnaW4odiksIHN0ZDo6ZW5kKHYpLAogICAgICAgICAgICAgICAgICAgICBzdGQ6OmJlZ2luKHYpLCBzdGQ6Om11bHRpcGxpZXM8ZG91YmxlPigpKTsKCiAgICBzdGQ6OmNvcHkoc3RkOjpiZWdpbih2KSwgc3RkOjplbmQodiksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RkOjpvc3RyZWFtX2l0ZXJhdG9yPGRvdWJsZT4oc3RkOjpjb3V0LCAiICIpKTsKfQo=