#include using namespace std; struct rnr { double speed; int startPosX, startPosY; int startComputer; }; struct pc { int posX, posY; bool reached = false; }; int n, k; // n = number of computers, k = number of runners rnr runners[100005]; pc computers[100005]; int computerIndexReferenced = 1; int runnerIndexReferenced = 1; int main() { freopen("runners.in", "r", stdin); freopen("runners.out", "w", stdout); scanf("%d %d", &n, &k); for (int i = 1; i <= k; ++i) { scanf("%lf", &runners[i].speed); } for (int i = 1; i <= n; ++i) { scanf("%d %d", &computers[i].posX, &computers[i].posY); } for (int i = 1; i <= k; ++i) { runners[i].startPosX = computers[computerIndexReferenced].posX; runners[i].startPosY = computers[computerIndexReferenced].posY; runners[i].startComputer = computerIndexReferenced; computers[computerIndexReferenced].reached = true; printf("%d %d\n", runners[i].startPosX, runners[i].startPosY); computerIndexReferenced = computerIndexReferenced+1; if (computerIndexReferenced > n) { computerIndexReferenced = 1; } } for (int i = 1; i <= k && i <= n; ++i) { printf("%d\n", i); } for (int i = 1; i <= n; ++i) { if (computers[i].reached == false) { printf("%d\n", runnerIndexReferenced); runnerIndexReferenced = runnerIndexReferenced+1; if (runnerIndexReferenced > k) { runnerIndexReferenced = 1; } } } return 0; }