Chinese Remainder Theorem, Only 4 test cases are passing

Can you help me to identify the mistake?