#include <iostream>
#include <vector>

using namespace std;

struct node
{
    vector <int> edge;
    vector <int> price;

    bool visited, end_of_graph;
    int parent;

    node()
    {
        visited=false;
        end_of_graph=false;
        parent=-1;
    }

    void add(int n)
    {
        edge.push_back(n);
    }
    void cost(int n)
    {
        price.push_back(n);
    }
    void set_as_end()
    {
        end_of_graph==true;
    }

};
int main()
{
    vector <node> graph;

    for(int x=0; x<5; x++)
        graph.push_back(node());

    //adding edges

    graph[0].add(1); graph[0].cost(4);
    graph[0].add(2); graph[0].cost(1);
    graph[0].add(3); graph[0].cost(4);

    graph[1].add(3); graph[1].cost(1);

    graph[2].add(1); graph[2].cost(1);
    graph[2].add(3); graph[2].cost(5);

    graph[3].set_as_end();

    vector <int> lista;

    return 0;
}
