int int_rand(int n) { return int(rand()/(RAND_MAX + 1.0) * n ); }