sclass ManyCirclePainter { int w, int h; new L circles; int[] pixels; L[] startCircle, stopCircle; srecord Circle(Pt center, int radius) {} run { pixels = new int[w*h]; if (pixels.length == 0) ret; startCircle = new L[h]; stopCircle = new L[h]; for (circle : circles) { int y1 = max(0, circle.center.y-radius); int y2 = circle.center.y+radius+1; if (y1 >= y2) continue; startCircle[y1] = addOrCreate(startCircle[y1], circle); if (y2 < h) stopCircle[y2] = addOrCreate(stopCircle[y2], circle); } for y to h: { } } }