#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ fabs(double);
scalar_t__ pow(scalar_t__, double);
int /*<<< orphan*/ printf(char *, scalar_t__);
int /*<<< orphan*/ scanf(char *, double *, ...);
int main() {
  double x1, y1, x2, y2, p;
  while (1) {
    scanf("%lf", &x1);
    if (x1 == 0)
      break;
    scanf("%lf %lf %lf %lf", &y1, &x2, &y2, &p);
    printf("%.10lf\n",
           pow(pow(fabs(x1 - x2), p) + pow(fabs(y1 - y2), p), 1.0 / p));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebe(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    117e <main+0x3e>
jp     117e <main+0x3e>
jmp    1205 <main+0xc5>
lea    0xe83(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
lea    -0x30(%rbp),%r8
mov    $0x0,%al
call   1050 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,%rdi
movsd  -0x30(%rbp),%xmm0
call   1060 <pow@plt>
mov    %rax,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,%rdi
movsd  -0x30(%rbp),%xmm0
call   1060 <pow@plt>
mov    -0x38(%rbp),%rdi
add    %rax,%rdi
movsd  0xe19(%rip),%xmm0
divsd  -0x30(%rbp),%xmm0
call   1060 <pow@plt>
mov    %rax,%rsi
lea    0xe1d(%rip),%rdi
call   1030 <printf@plt>
jmp    114f <main+0xf>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xebf(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1174 <main+0x34>
jnp    1238 <main+0xf8>
lea    0x10(%rsp),%r13
lea    0x8(%rsp),%rbx
lea    0xe93(%rip),%rbp
lea    0xe88(%rip),%r14
mov    %rsp,%r15
nop
lea    0xe71(%rip),%rdi
lea    0x20(%rsp),%rsi
lea    0x18(%rsp),%rdx
mov    %r13,%rcx
mov    %rbx,%r8
xor    %eax,%eax
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
subsd  0x18(%rsp),%xmm0
call   1040 <fabs@plt>
movsd  0x8(%rsp),%xmm0
mov    %rax,%rdi
call   1060 <pow@plt>
mov    %rax,%r12
movsd  0x20(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
call   1040 <fabs@plt>
movsd  0x8(%rsp),%xmm0
mov    %rax,%rdi
call   1060 <pow@plt>
add    %rax,%r12
movsd  0xe07(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
mov    %r12,%rdi
call   1060 <pow@plt>
mov    %rbp,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
xorpd  %xmm1,%xmm1
movsd  (%rsp),%xmm0
ucomisd %xmm1,%xmm0
jne    1190 <main+0x50>
jp     1190 <main+0x50>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [16 x i8] c"%lf %lf %lf %lf\00"
@.str.2 = [8 x i8] c"%.10lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
br label %7
7: ; preds = %0, %12
%8 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%9 = load double, double* %2
%10 = fcmp oeq double %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %7
br label %31
12: ; preds = %7
%13 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double* %3, double* %4, double* %5, double* %6)
%14 = load double, double* %2
%15 = load double, double* %4
%16 = fsub double %14, %15
%17 = call i64 @fabs(double %16)
%18 = load double, double* %6
%19 = call i64 @pow(i64 %17, double %18)
%20 = load double, double* %3
%21 = load double, double* %5
%22 = fsub double %20, %21
%23 = call i64 @fabs(double %22)
%24 = load double, double* %6
%25 = call i64 @pow(i64 %23, double %24)
%26 = add nsw i64 %19, %25
%27 = load double, double* %6
%28 = fdiv double 1.000000e+00, %27
%29 = call i64 @pow(i64 %26, double %28)
%30 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i64 %29)
br label %7
31: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [16 x i8] c"%lf %lf %lf %lf\00"
@.str.2 = [8 x i8] c"%.10lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = bitcast double* %1 to i8*
%7 = bitcast double* %2 to i8*
%8 = bitcast double* %3 to i8*
%9 = bitcast double* %4 to i8*
%10 = bitcast double* %5 to i8*
%11 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%12 = load double, double* %1
%13 = fcmp oeq double %12, 0.000000e+00
br i1 %13, label %36, label %14
14: ; preds = %0, %14
%15 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %3, double* %4, double* %5)
%16 = load double, double* %1
%17 = load double, double* %3
%18 = fsub double %16, %17
%19 = call i64 @fabs(double %18)
%20 = load double, double* %5
%21 = call i64 @pow(i64 %19, double %20)
%22 = load double, double* %2
%23 = load double, double* %4
%24 = fsub double %22, %23
%25 = call i64 @fabs(double %24)
%26 = load double, double* %5
%27 = call i64 @pow(i64 %25, double %26)
%28 = add nsw i64 %27, %21
%29 = load double, double* %5
%30 = fdiv double 1.000000e+00, %29
%31 = call i64 @pow(i64 %28, double %30)
%32 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i64 %31)
%33 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%34 = load double, double* %1
%35 = fcmp oeq double %34, 0.000000e+00
br i1 %35, label %36, label %14
36: ; preds = %14, %0
ret i32 0
}