#include "minecraft.h"
#include <bits/stdc++.h>
#include <vector>

void Solve_Portals(int l, int r, int k, vector<int>& result)
{
    if (k == 0) return;
    if(r - l + 1 = k)
    {
        for(int i = l; i <= r; i++)
            result.push_back(i);
        return;
    }
    if (l == r)
    {
        result.push_back(l);
        return;
    }

    int mid = l + (r - l) / 2;
    int left_k = find_portals(l, mid);

    Solve_Portals(l, mid, left_k, result);
    Solve_Portals(mid + 1, r, k - left_k, result);
}

vector<int> portals(int N, int K)
{
    vector<int> result;
    Solve_Portals(1, N, K, result);
    return result;
}

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