<?php
10,
20,
100,
30,
40,
104,
200,
202,
33
);
$bestValue1 = $numbers[0];
$bsetValue2 = $numbers[1];
$lastDif = abs($numbers[0] - $numbers[1]);
for ($i = 1; $i < count($numbers); $i++) {
for ($k = 0; $k < $i; $k++) {
$dif = abs($numbers[$k] - $numbers[$i]);
if ($dif == 0) {
continue;
}
if ($dif < $lastDif) {
$lastDif = $dif;
$bestValue2 = $numbers[$k];
$bestValue1 = $numbers[$i];
}
}
}
$bestValue1,
$bestValue2
);
?>
PD9waHAKJG51bWJlcnMgICAgPSBhcnJheSgKICAgIDEwLAogICAgMjAsCiAgICAxMDAsCiAgICAzMCwKICAgIDQwLAogICAgMTA0LAogICAgMjAwLAogICAgMjAyLAogICAgMzMKKTsKJGJlc3RWYWx1ZTEgPSAkbnVtYmVyc1swXTsKJGJzZXRWYWx1ZTIgPSAkbnVtYmVyc1sxXTsKJGxhc3REaWYgICAgPSBhYnMoJG51bWJlcnNbMF0gLSAkbnVtYmVyc1sxXSk7Cgpmb3IgKCRpID0gMTsgJGkgPCBjb3VudCgkbnVtYmVycyk7ICRpKyspIHsKICAgIAogICAgZm9yICgkayA9IDA7ICRrIDwgJGk7ICRrKyspIHsKICAgICAgICAKICAgICAgICAkZGlmID0gYWJzKCRudW1iZXJzWyRrXSAtICRudW1iZXJzWyRpXSk7CiAgICAgICAgCiAgICAgICAgaWYgKCRkaWYgPT0gMCkgewogICAgICAgICAgICBjb250aW51ZTsKICAgICAgICB9CiAgICAgICAgaWYgKCRkaWYgPCAkbGFzdERpZikgewogICAgICAgICAgICAkbGFzdERpZiAgICA9ICRkaWY7CiAgICAgICAgICAgICRiZXN0VmFsdWUyID0gJG51bWJlcnNbJGtdOwogICAgICAgICAgICAkYmVzdFZhbHVlMSA9ICRudW1iZXJzWyRpXTsKICAgICAgICB9CiAgICB9CiAgICAKfQokcGFpciA9IGFycmF5KAogICAgJGJlc3RWYWx1ZTEsCiAgICAkYmVzdFZhbHVlMgopOwpwcmludF9yKCRwYWlyKTsKCj8+