#include <iostream>

using namespace std;

int main() {
    int n;
    cin >> n;

    double num;
    cin >> num;

    double current = num; 
    double max_val = num; 

    for (int i = 1; i < n; i++) {
        cin >> num;

        if (current * num > num) {
            current = current * num;
        } else {
            current = num;
        }

        if (current > max_val) {
            max_val = current;
        }
    }

    cout << fixed;
    cout.precision(3);
    cout << max_val << endl;

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: