define fast_gcd(a, b) { if (a == b) return a; if (a > b) return fast_gcd(a - b, b) return fast_gcd(a, b - a); } define void r_reduce(*r[]) { auto g,s; if (length(r[]) != 2) sqrt(-1); if (scale(r[0])) 2^r[0]; if (scale(r[1])) 2^r[1]; if (r[0] >= 0 && r[1] >= 0) g = fast_gcd(r[0], r[1]); else g = gcd(r[0], r[1]); s = scale; scale = 0; r[0] /= g; r[1] /= g; scale = s; } define void r_init(*r[], a, b) { r[0] = a; r[1] = b; r_reduce(r[]); } define void r_initi(*r[], i, a, b) { length(r[]); r[0] = i * b + a; r[1] = b; length(r[]); r_reduce(r[]); } length(a[]) r_initi(a[], 5, 63, 94);