You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
319 B

8 months ago
<?php
$in = file("input.txt");
foreach ($in as &$inv) {
$inv = (int)trim($inv);
}
$ans = array();
sort($in);
$x = 0;
while ($x < count($in)-1) {
array_push($ans,$in[$x + 1] - $in[$x]);
$x++;
}
$ans = array_count_values($ans);
foreach($ans as &$a) {
$a++;
}
$aaa = $ans[1] * $ans[3];
echo $aaa;