sub decode2 { my $dc; $_[0] = -$_[0]; $dc -= $_ for @_; # subtract the sum of all elements from the first my $original= $dc/@_ - $_[1]; my $next; return map { $next += $_ } $original, splice @_, 1; }