#include "minecraft.h"
#include <bits/stdc++.h>
using namespace std;

vector <int> dnc(int l, int r) {
    int m = (l + r) / 2;
    if (l == r) {
        return {l};
    }
    int ql = find_portals(l, m);
    int qr = find_portals(m + 1, r);
    vector <int> ansl;
    vector <int> ansr;
    if (ql) {
        ansl = dnc(l, m);
    }
    if (qr) {
        ansr = dnc(m + r);
    }
    for (auto x : ansr) {
        ansl.push_back(x);
    }
    return ansl;
}

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

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