#include <iostream>
#include <string>
#include <vector>
#include <map>

class Package {
public:
    double val;
    double calculate_cost(){
        return this->val;
    }
    Package(double val):val(val){}
};

int main(){
    std::map<std::string, std::vector<Package*>> packagemap;

    //dados de teste
    std::vector<Package*> package1;
    package1.push_back(new Package(10));
    package1.push_back(new Package(15));
    package1.push_back(new Package(13));
    packagemap.insert(std::make_pair("test1", package1));


    std::vector<Package*> package2;
    package2.push_back(new Package(20));
    package2.push_back(new Package(35));
    package2.push_back(new Package(56));
    packagemap.insert(std::make_pair("test2", package2));

    //calcular o total
    double total = 0;
    for (auto package_entry : packagemap){
        for (auto package_ptr: package_entry.second){
            total += package_ptr->calculate_cost();
        }
    }

    std::cout << total;

    return 0;
}
