#!/usr/bin/perl use strict; use warnings; my $n = <>; my $str = <>; chomp $str; my @array = split / /, $str; if($n < 1) { print "0\n"; exit; } @array = reverse sort {$a <=> $b} @array; my $ans = $array[0] - $array[1]; for(my $i = 0; $i < $n - 1; $i++) { if($array[$i] - $array[$i + 1] < $ans) { $ans = $array[$i] < $array[$i + 1]; } } print "$ans\n"; exit;