import patterns; add("hatch", crosshatch(1mm)); defaultpen(2); bbox(white, Fill); size(1024, 0); int n = stdin; int sx = stdin; int sy = stdin; for (int i = 0; i < n; ++i) { int ax = stdin; int ay = stdin; int bx = stdin; int by = stdin; draw((ax*10, ay*10) -- (bx*10, by*10)); filldraw(circle((ax*10, ay*10), 1), fillpen=black); filldraw(circle((bx*10, by*10), 1), fillpen=black); pair lp = (ay < by || ay == by && ax > bx ? (ax, ay) : (bx, by)); draw(circle((lp.x*10+1, lp.y*10-3), 1.5), (lp.x*10+1, lp.y*10-3)); label(scale(3) * format('%d', i+1), (lp.x*10+1, lp.y*10-3)); } int tx = stdin; int ty = stdin; if (!eof(stdin)) { path route; for (int i = 0; i < n + 2; ++i) { real x = stdin; real y = stdin; route = route -- (x*10, y*10); } draw(route, orange); } filldraw(circle((sx*10, sy*10), 2), fillpen=green); for (int i = 0; i < 4; ++i) { filldraw(circle((tx*10, ty*10), 2 - i / 2.0), fillpen=(i%2==0? red: white)); } fill(circle((sx*10, sy*10), 2 - 3 / 2.0), green); shipout(bbox(xmargin=2, white, Fill));