// use it only on inputs that are random ints // always gives a positive number static int mod_31bit(int n, int m) { ret (n & 0x7FFFFFFF) % m; }