import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

double calc(long[] xs, long[] ys, int p) {
    int n = cast(int)xs.length;

    double s = iota(n).map!(e => abs(xs[e] - ys[e]) ^^ p).sum;
    return s ^^ (1.0 / p);
}

void main() {
    int n = readint;
    auto xs = reads!long;
    auto ys = reads!long;

    foreach (p; 1..4) {
        writefln("%.6f", calc(xs, ys, p));
    }

    auto c = iota(n).map!(e => abs(xs[e] - ys[e])).reduce!max;
    writeln(c);
}
