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

int main(int argc, char **argv) 
{
    int start = atoi(argv[1]);
    int end = atoi(argv[2]);
    srand(atoi(argv[3]));

    for (int i = start; i <= end; i++) 
    {
        char fn[32];
        sprintf(fn, "%02d", i);
        freopen(fn, "w", stdout);
        int m = rand() % primecount;
        int d = rand() % maxdeg[m];
        __int64 v = 1;
        for (int j = 0; j < d; j++) {
            v *= primes[m];
        }
        printf("%I64d\n", v);
    }
    return 0;
}