// Graph Generator for PA1 of the APPROXIMATION ALGORITHMS
// Takes two arguments, first is the number of vertices, second is the density of the graph.
#include <iostream>
#include <cstdlib>
#include <set>
#include <vector>
#include <iomanip>
#include <cstdio>
#include <time.h>
using namespace std;

int main(int argc, char* argv[])
{
   srand(time(0));
   int points = atoi(argv[1]);
   double density = atoi(argv[2])/100.0;
   double kdensity = atoi(argv[3])/100.0;
   int repeat = atoi(argv[4]);
   int MaxWeight = atoi(argv[5]);
   printf("%d\n", points);
   printf("%f\n", kdensity);
   printf("%d\n", repeat);
   for (int i=1; i<points+1; i++)
     for (int j=i; j<points+1; j++) {
       double x = rand()/double(RAND_MAX);
       if (x < density && i!=j)
          printf("%d\t%d\t%d\n", i, j, int (rand()/double(RAND_MAX)*MaxWeight)+1);
     }
   return 0;
}

