#!/usr/bin/env perl my ($b1, $b2, $b3) = split / /, <>; chomp $b3; my $r = ($b3 - $b2) / ($b2 - $b1); my $d = $b3 - $r * $b2; print $r * $b3 + $d;