#include "minecraft.h"
#include <bits/stdc++.h>
using namespace std;
int n,k;
vector <int> v;
int dnc(int l,int r,int val)
{
    if(val==0)return val;
    if(l==r)
    {
        v.push_back(l);
        return val;
    }
    int mid=(l+r)/2;
    int v=val;
    val-=dnc(l,mid,find_portals(l,mid));
    val-=dnc(mid+1,r,val);
    return v;
}
std::vector<int> portals(int N, int K)
{
    n=N;
    k=K;
    dnc(1,N,k);
    return v;
}

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