Functions

modulus of pairs must be pairwise coprime. but taking modulus is not necessarily coprime with others or prime itself. v_i = t_0 + t_1m_0 + t_2m_0m_1 + … + t_i\prod_{j<i}{m_j} t_i = (r_i - v_{i-1})(\prod_{j<i}{m_j})^{-1} ( mod m_i) (v_{-1} = 0)