wims_print_precision=8

essai=
vide=no

!for i=1 to $Degree
	m_$i=!item 2 of $(m_$i)
!next i

y_1=$(x_1)
p_1=$(m_1)
n=$[$Degree-1]

!if $cmd=reply
  !for i=1 to $n
     pari_out=!exec pari print(chinese(Mod($(y_$i),$(p_$i)),Mod($(x_$[$i+1]),$(m_$[$i+1]))))
	pari_out=!char 5 to -2 of $(pari_out)
	y_$[$i+1]=!item 1 of $(pari_out)
	p_$[$i+1]=!item 2 of $(pari_out)
  !next i

  reste=$(y_$Degree)
  modul=$(p_$Degree)

d=!charcnt $reste

!for i=1 to $Degree
  t$i=!charcnt $(x_$i)
  s$i=!charcnt $(m_$i)
  !ifval $(t$i)=0 or $(s$i)=0
     essai=yes
     vide=yes
     wims_module_log=$cmd: equat=$Degree case_vide=yes
  !else 
     !ifval $d=0
       wims_module_log=$cmd: equat=$Degree sol=no case_vide=no
     !else $d!=0
       wims_module_log=$cmd: equat=$Degree sol=yes case_vide=no
     !endif
  !endif
!next i


!endif

!if $cmd=new or $cmd=renew
  wims_module_log=$cmd: equations=$Degree
!endif
