C language: Chinese remainder theorem