program engines
  implicit none
  integer :: n, i, j
  real(8) :: x(100) = 0.d0, y(100) = 0.d0, a, b, ans = 0.d0
  character(64) :: tmp
  read(*,*) n
  do i = 1, n
    read(*,*) x(i), y(i)
  end do
  do i = 1, n
    a = x(i)
    b = y(i)
    do j = 1, n
      if (j == i) cycle
      if (d(a+x(j),b+y(j)) > d(a,b)) then
        a = a+x(j)
        b = b+y(j)
      end if
    end do
    ans = max(ans,d(a,b))
  end do
  write(tmp,'(f50.20)') ans
  write(*,'(a)') trim(adjustl(tmp))
contains
  real(8) function d(x,y)
    real(8), intent(in) :: x, y
    d = sqrt(x*x+y*y)
  end
end program engines