<?php $a = array(); $n = (int)fgets(STDIN); $mch1 = 101; $mch2 = 101; $mne1 = 101; $mne2 = 101; $min1 = 0; $min2 = 0; for($i=1;$i<=$n;$i++) { $x = (int)fgets(STDIN); if($x<0) { $sum = $sum + $x; if(($x%2 == 0)and($x < $mch1)) { $mch1 = $x; } if(($x%2 != 0)and($x < $mne1)) { $mne1 = $x; } } else if(x>0) { if(($x%2 == 0)and($x < $mch2)) { $mch2 = $x; } if(($x%2 != 0)and($x < $mne2)) { $mne2 = $x; } } if($sum%2 != 0) { } } if((($mch1 == 101)or($mch2 == 101))and(($mne1 == 101)or($mne2 == 101))) { echo 'NO'; } ?>
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more