#!/usr/bin/env perl use strict; use warnings; use feature qw (say); use ntheory qw/chinese lcm/; say chinese( [2328,16256], [410,5418] ), " mod ", lcm(16256,5418); # 28450328 mod 44037504 use Math::ModInt qw(mod); use Math::ModInt::ChineseRemainder qw(cr_combine); say cr_combine(mod(2,3),mod(3,5),mod(2,7)); # mod(23, 105)