#include <stdlib.h>

void main (void) {
  bsol sol1, sol2, emptysol;
  prob pb,pbtemp;
  probloc ploc;

  srand(0);
  sol1.create();  // create a random solution
  emptysol.empty();  // create an empty solution
  pb.create(sol1);  // create a problem from the solution
  sol2.empty();  // sol2 will be an "alternate" solution
  while (!sol2.overflow()) {
    sol2 = findsol(pb,emptysol); 
    while ((sol2 == sol1) && !sol2.overflow())
      sol2 = findsol(pb,sol2);  // find an alternate solution
    if (!sol2.overflow())
      pb.markdiff(sol1,sol2);  // if there is one, change the problem
  }
  for (ploc.empty();!ploc.overflow();ploc.next(pb)) {
       // Are we giving unnecessary help?
    pbtemp = pb;
    pbtemp.clear(ploc);
    sol2 = findsol(pbtemp,emptysol);
    sol2 = findsol(pbtemp,sol2);
    if (sol2.overflow())
      pb.clear(ploc);
  }
}
