← RoseCode

ROSECODE 351

In or out?

Philippe_57721 · Programming ·

Let the following pseudo-random generator:
static long seed = 641;
static long FastRandom()
{
	seed = (214013 * seed + 2531011) % 2147483647;
	return seed;
}
We consider the first 60000 values of this generator modulo 1000 as the coordinates of 10000 triangles:
T1=(344,302)(678,941)(488,674)
T2=(107,545)(964,568)(808,239)

T10000=(862,679)(571,263)(391,426)

How many times is the point (499,499) inside one of these triangles?

[My timing : < 1 sec]