#include "tools.h"

const int POINTS_IN_CIRCLE = 10000000;

int r, k, n;

double getX(int point) {
    double angle = (point + POINTS_IN_CIRCLE / 4) * 2 * PI / POINTS_IN_CIRCLE;
    return r * cos(angle);
}

double getY(int point) {
    double angle = (point + POINTS_IN_CIRCLE / 4) * 2 * PI / POINTS_IN_CIRCLE;
    return r * sin(angle);
}

int main(int argc, char **argv) {
    r = atoi(argv[1]);
    k = atoi(argv[2]);
    n = atoi(argv[3]);
    srand(atoi(argv[4]));

    assert(r < k);

    set<int> used;
    vector<Hair> output;

    for (int i = 0; i < n; i++) {
        int index = 1 + random() % (POINTS_IN_CIRCLE - 1);
        if (used.find(index) == used.end()) {
            Hair h;
            h.xh = getX(index);
            h.yh = getY(index);
            h.xs = getBound(h.xh, h.yh, k);
            h.ys = -k;
            output.push_back(h);
            used.insert(index);
        } else {
            i--;
        }
    }

    random_shuffle(output.begin(), output.end());

    printf("%d %d\n%d\n", r, k, n);
    for (int i = 0; i < n; i++) {
        output[i].print();
    }
    return 0;
}