#!/usr/bin/perl use warnings; use strict; my ($first, $last, $last_small) = ('0e0', 0, 0); while () { my ($big, $small) = split; next if 4 >= $small; if ($big > $first + 50) { show($first, $last, $last_small); $first = $big; } $last = $big; $last_small = $small; } show($first, $last, $last_small); sub show { my ($first, $last, $last_small) = @_; print "$first ", $last + 50, " $last_small\n" unless '0e0' eq $first; } __DATA__ 109026 3 109027 28 109028 30 116958 15 116960 35 116961 39 116962 70 116963 72 147184 2 147588 1 153087 32