Guest User

Untitled

a guest
Oct 21st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. use strict;
  2. use warnings;
  3. use 5.12.4;
  4.  
  5. chomp(my $n = <STDIN>);
  6. chomp(my @line = <STDIN>);
  7.  
  8. my $result = 0;
  9.  
  10. for my $now_point (@line){
  11. for my $target_point (@line){
  12.  
  13. my @now_point = split / /, $now_point;
  14. my @target_point = split / /, $target_point;
  15.  
  16. my $x = abs ($now_point[0] - $target_point[0]);
  17. my $y = abs ($now_point[1] - $target_point[1]);
  18. my $route = sqrt ($x*$x + $y*$y);
  19.  
  20. if( $result < $route ){
  21. $result = $route;
  22. }
  23. }
  24. }
  25.  
  26. print $result,"\n";
Add Comment
Please, Sign In to add comment