#include using namespace std; struct City { double x, y; long long w; }; struct Flight { int a; int dep; int b; int arr; }; // times in minutes from midnight int travel_time_minutes(double x1, double y1, double x2, double y2) { double d = hypot(x1 - x2, y1 - y2); double raw = 60.0 * d / 800.0 + 40.0; int tt = (int)ceil(raw / 5.0) * 5; return tt; } string fmt_time(int t){ int hh = t / 60; int mm = t % 60; char buf[6]; sprintf(buf, "%02d:%02d", hh, mm); return string(buf); } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N; int R; if(!(cin >> N >> R)) return 0; vector cities(N); for(int i=0;i> xi >> yi >> wi; cities[i].x = (double)xi; cities[i].y = (double)yi; cities[i].w = wi; } int M; cin >> M; for(int i=0;i> a >> s_str >> b >> t_str; } int K; cin >> K; const int START = 6*60; // 360 const int END = 21*60; // 1260 // Edge: no other cities if(N == 0){ for(int k=0;k cities[hub].w) hub = i; } // 2) build sorted list of other cities by population desc vector> vec; for(int i=0;i B.first; return A.second < B.second; }); int needSpokes = 25; int topCount = min((int)vec.size(), needSpokes); vector targets; for(int i=0;i> schedules(K); if(topCount == 0){ for(int k=0;k END) break; schedules[k].push_back({cur, dep, next, arr}); cur = next; time = arr; } } for(int k=0;k