#define _CRT_SECURE_NO_WARNINGS

#include <stdlib.h>
#include <stdio.h>

#define LINES (100*1000)
#define COLS 45

void usage()
{
    printf("gen_cvs [<lines>]\n");
    exit(1);
}

int main(int argc, char **argv)
{
    int lines = LINES, cols = COLS;
    int c, i, j;

    if (argc > 1)
        lines = strtol(argv[1], NULL, 10);

    if (lines < 1)
        usage();

    if (!freopen("list.txt", "wb", stdout))
        return -1;

    for (i = 0; i < lines; i++) {
        for (j = 0; j < cols; j++) {
            c = (j < cols - 1)? ' ' : '\n';
            printf("%d;%c", i*j, c);
        }
    }

    return ferror(stdout)? 1 : 0;
}
