<?php
$khal = [100, 200, 101, 201];
$count = INF;
for($i = 0; $i < count($khal); $i++){ for ($n = 0; $n < count($khal); $n++){ if($i==$n){
continue;
}
$jorah = abs($khal[$i]-$khal[$n]);
if($jorah < $count){
$count = $jorah;
$mormont[0]=$khal[$i];
$mormont[1]=$khal[$n];
}
}
}
PD9waHAKCiRraGFsID0gWzEwMCwgMjAwLCAxMDEsIDIwMV07CiRtb3Jtb250ID0gYXJyYXkoKTsKJGNvdW50ID0gSU5GOwoKZm9yKCRpID0gMDsgJGkgPCBjb3VudCgka2hhbCk7ICRpKyspewpmb3IgKCRuID0gMDsgJG4gPCBjb3VudCgka2hhbCk7ICRuKyspewoJaWYoJGk9PSRuKXsKCQljb250aW51ZTsKCX0KCQoJJGpvcmFoID0gYWJzKCRraGFsWyRpXS0ka2hhbFskbl0pOwoKCQoJaWYoJGpvcmFoIDwgJGNvdW50KXsKCQkkY291bnQgPSAkam9yYWg7CgkJJG1vcm1vbnRbMF09JGtoYWxbJGldOwoJCSRtb3Jtb250WzFdPSRraGFsWyRuXTsKCX0KfQp9Cgp2YXJfZHVtcCAoJG1vcm1vbnQpOw==