
n = gets.to_i
x = [0,0,0,0,0,0,0,0,0]
y = [0,0,0,0,0,0,0,0,0]
for i in 1..n
    dx,dy = gets.split(" ").map(&:to_f)
    if dx == 0 then
        if x[1].abs <= (x[1]+dy).abs then
           
            x[1] += dx
            y[1] += dy
            #puts "added 1"
        end
        if x[3].abs <= (x[3]+dy).abs then
            x[3] += dx
            y[3] += dy
            #puts "added 3"
        end

    elsif dx > 0
        x[1] += dx
        y[1] += dy
        #puts "added 1"
    else
        x[3] += dx
        y[3] += dy
        #puts "added 3"
    end
    if dy == 0 then
        if x[2].abs <= (x[2]+dx).abs then
            x[2] += dx
            y[2] += dy
            #puts "added 2"
        end
        if x[4].abs <= (x[4]+dx).abs then
            x[4] += dx
            y[4] += dy
            #puts "added 4"
        end
    elsif dy > 0
        x[2] += dx
        y[2] += dy
        #puts "added 2"
    else
        x[4] += dx
        y[4] += dy
        #puts "added 4"
    end

    if dx+dy >= 0 then
        x[5] += dx
        y[5] += dy
    end
    if -dx+dy >= 0 then
        x[6] += dx
        y[6] += dy
    end
    if -dx-dy >= 0 then
        x[7] += dx
        y[7] += dy
    end
    if dx-dy >= 0 then
        x[8] += dx
        y[8] += dy
    end
end
dist = 0.0
for i in 1..8
    disttmp = Math.sqrt(x[i]*x[i] + y[i]*y[i])
    if dist < disttmp then
        dist = disttmp
    end
end
puts "#{dist}"