// $Id: random.elastic,v 1.0 2002/05/09 15:36:00 dada Exp $
package random;

import basic;
import sys;
import array;

local IM = 139968;
local IA = 3877;
local IC = 29573;

private function gen_random( n )
{
    static LAST = 42.0;
    LAST = (LAST * IA + IC) % IM;
    return(n * LAST / IM);
}

private n = 1;
private result = 0;
if(array.length(sys.args) > 0) {
    n = basic.int(sys.args[0]);
} else {
    n = 1;
}
while(n--) {
    result = gen_random(100.0);
}
basic.print(result);