#include "minecraft.h"
#include <vector>


void solvep(int l , int r , int k , std::vector <int>& ret)
{
    if (k == 0)
        return;
    
    if (l == r)
    {
        for (int i = 0; i < k; i++)
            ret.PB(l);
        return;
    }
    
    int mid = (l + r) / 2;
    int le = find_portals(l , mid);
    if (le > 0)
        solvep(l , mid , le , ret);
    
    int ri = k - le;
    if (ri > 0)
        solvep(mid + 1 , r , ri , ret);
}


std::vector<int> portals(int n, int k)
{
    std::vector <int> ret;
    solvep(1 , n , k , ret);
    return ret;
}

std::pair<int, int> minimal_danger(int N, std::vector<std::pair<int, std::pair<int, int>>> paths, std::vector<int> portals, std::vector<int> fortresses)
{
    return {0, 0};
}

std::pair<int, int> find_end_portal(int L)
{
    return {1, 1};
}