#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
int timer = -1;
void dfs(int node, int prev, vector<vector<int>> &adj, vector<int> &tin, vector<int> &tout) {
tin[node] = ++timer;
for (auto &neighbour : adj[node]) {
if (neighbour == prev) continue;
dfs(neighbour, node, adj, tin, tout);
}
tout[node] = timer;
}
int enc(int in, int out) {
return (in + out * (1 << 10));
}
pair<int, int> dec(int x) {
int tin = 0, tout = 0;
for (int i = 0; i <= 9; i++) {
tin += x & (1 << i);
}
for (int i = 10; i <= 19; i++) {
bool h = x & (1 << i);
if (h) tout += (1 << (i - 10));
}
return {tin, tout};
}
vector<int> label(int n, int k, vector<int> u, vector<int> v) {
vector<vector<int>> adj(n); vector<int> tin(n), tout(n);
vector<int> ans(n);
for (int i = 0; i < n; i++) ans[i] = i;
return ans;
}
bool cont(pair<int, int> &a, pair<int, int> &b) {
if (a.first <= b.first && b.second <= a.second) return true;
else return false;
}
int find_next_station(int s, int t, std::vector<int> c) {
if (s < t) return c[1];
else return c[0];
}