Language: C

#include<iostream>
#include <boost/math/distributions/normal.hpp>
#include <boost/math/distributions/poisson.hpp>
#include <boost/math/distributions/binomial.hpp>
#include <boost/math/distributions/chi_squared.hpp>

using namespace std;

int main() {



    // 整数の入力 スペース区切りの整数の入力
    int A, B, C, D, E, F;
    cin >> A >> B >> C >> D >> E >> F;


    int w_suger_water = 0;
    int w_suger = 0;

    int current_water_mass = 0;

    bool enable_action1 = true;
    bool enable_action2 = true;

    std::vector<int> beaker_state;

    //seed
    {

        if (100 * A <= F) {
            beaker_state.push_back(100 * A);
        }

        if (100 * B <= F) {
            beaker_state.push_back(100 * B);
        }

    }

    //すべての組み合わせの結果を得る
    while (enable_action1 || enable_action2) {

        for (const auto &i : beaker_state) {

            //cout<< "gg"<<endl;
            if ((100 * A + i) <= F) {
                beaker_state.push_back(100 * A);
            } else {
                enable_action1 = false;
            }

            if ((100 * B + i) <= F) {
                beaker_state.push_back(100 * B);
            } else {
                enable_action2 = false;
            }
        }

    }

    std::vector<double> result;
    std::vector<pair<int,int>> finalresult;

    for (int iter = 0; iter < beaker_state.size(); iter++) {


        int tmp_water_mass = beaker_state[iter];
        int max_suger_mass = (tmp_water_mass / 100) * E;

        std::vector<int> target_suger_mass = {0};


        bool enable_action3 = true;
        bool enable_action4 = true;

        while (enable_action3 || enable_action4) {
            for (const int &currentsuger : target_suger_mass) {
                //action3
                if (currentsuger + C <= max_suger_mass && currentsuger + C +tmp_water_mass <= F) {

                    target_suger_mass.push_back(currentsuger + C);
                } else {
                    enable_action3 = false;
                }

                //action4
                if (currentsuger + D <= max_suger_mass&& currentsuger + D +tmp_water_mass <= F) {
                    target_suger_mass.push_back(currentsuger + D);
                } else {
                    enable_action4 = false;
                }
            }
        }

        //get max index of suger state
        std::vector<int>::iterator iter1 = std::max_element(target_suger_mass.begin(), target_suger_mass.end());
        size_t index1 = static_cast<size_t>(std::distance(target_suger_mass.begin(), iter1));

        double concentration = (100*target_suger_mass[index1])/(target_suger_mass[index1] + tmp_water_mass);

        result.push_back(concentration);
        finalresult.emplace_back(target_suger_mass[index1],tmp_water_mass);

    }


    //
    std::vector<double >::iterator iter2 = std::max_element(result.begin(), result.end());
    size_t index2 = static_cast<size_t>(std::distance(result.begin(), iter2));


    w_suger_water = finalresult[index2].second +finalresult[index2].first;
    w_suger= finalresult[index2].first;


// 出力
    cout << w_suger_water << " " << w_suger << endl;
    return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.