#include "minecraft.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> divide(int l,int r,int cnt)
{   
    if(cnt==0) return{};
    if(l==r)
    {
        return {l};
    }
    int m=(l+r)/2;
    int br=find_portals(l,m);
    vector<int> v1,v2;
    v1=divide(l,m,br);
    v2=divide(m+1,r,cnt-br);
    vector<int> ans=v1;
    for(int x:v2)
    {
        ans.push_back(x);
    }
    return ans;
}
std::vector<int> portals(int N, int K) 
{
    return divide(1,N,K);
}

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};
}