#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 */
double acos(double);
int /*<<< orphan*/ printf(char *, double, double);
int /*<<< orphan*/ scanf(char *, int *, int *, int *, int *, int *);
double sqrt(double);
int main() {
  int a, b, s, m, n;
  while (1) {
    scanf("%d %d %d %d %d", &a, &b, &s, &m, &n);
    if (!a && !b && !s && !m && !n)
      break;
    double dist_X = a * m;
    double dist_Y = b * n;
    double dist_total = sqrt(dist_X * dist_X + dist_Y * dist_Y);
    double velocity = dist_total / s;
    double angle = 180.0 * acos(dist_X / dist_total) /
                   3.1415926535897932384626433832795028841971693993751;
    printf("%.2f %.2f\n", angle, velocity);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
lea    -0x18(%rbp),%r9
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    11a6 <main+0x66>
cmpl   $0x0,-0xc(%rbp)
jne    11a6 <main+0x66>
cmpl   $0x0,-0x10(%rbp)
jne    11a6 <main+0x66>
cmpl   $0x0,-0x14(%rbp)
jne    11a6 <main+0x66>
cmpl   $0x0,-0x18(%rbp)
jne    11a6 <main+0x66>
jmp    1249 <main+0x109>
mov    -0x8(%rbp),%eax
imul   -0x14(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x18(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
call   1040 <acos@plt>
movaps %xmm0,%xmm1
movsd  0xdef(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xddb(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
lea    0xde0(%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    0x24(%rsp),%r15
lea    0x20(%rsp),%r12
lea    0xc(%rsp),%r13
lea    0x1c(%rsp),%rbx
lea    0x18(%rsp),%rbp
lea    0xeb9(%rip),%r14
jmp    11bf <main+0x7f>
movsd  %xmm2,0x10(%rsp)
call   1060 <sqrt@plt>
movsd  0x10(%rsp),%xmm2
xorps  %xmm1,%xmm1
cvtsi2sdl 0xc(%rsp),%xmm1
divsd  %xmm0,%xmm2
divsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movapd %xmm2,%xmm0
call   1040 <acos@plt>
mulsd  0xe57(%rip),%xmm0
divsd  0xe57(%rip),%xmm0
mov    %r14,%rdi
movsd  0x10(%rsp),%xmm1
call   1030 <printf@plt>
lea    0xe52(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
mov    %rbp,%r9
call   1050 <scanf@plt>
mov    0x24(%rsp),%ecx
mov    0x20(%rsp),%eax
mov    0x1c(%rsp),%esi
mov    0x18(%rsp),%edx
test   %ecx,%ecx
jne    1201 <main+0xc1>
test   %eax,%eax
jne    1201 <main+0xc1>
cmpl   $0x0,0xc(%rsp)
jne    1201 <main+0xc1>
test   %esi,%esi
jne    1201 <main+0xc1>
test   %edx,%edx
je     123c <main+0xfc>
imul   %ecx,%esi
xorps  %xmm2,%xmm2
cvtsi2sd %esi,%xmm2
imul   %eax,%edx
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
mulsd  %xmm1,%xmm1
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ucomisd 0xde3(%rip),%xmm0
jb     1170 <main+0x30>
sqrtsd %xmm0,%xmm0
jmp    1181 <main+0x41>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%d %d %d %d %d\00"
@.str.1 = [11 x i8] c"%.2f %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store i32 0, i32* %1
br label %12
12: ; preds = %0, %29
%13 = call i32 @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5, i32* %6)
%14 = load i32, i32* %2
%15 = icmp ne i32 %14, 0
br i1 %15, label %29, label %16
16: ; preds = %12
%17 = load i32, i32* %3
%18 = icmp ne i32 %17, 0
br i1 %18, label %29, label %19
19: ; preds = %16
%20 = load i32, i32* %4
%21 = icmp ne i32 %20, 0
br i1 %21, label %29, label %22
22: ; preds = %19
%23 = load i32, i32* %5
%24 = icmp ne i32 %23, 0
br i1 %24, label %29, label %25
25: ; preds = %22
%26 = load i32, i32* %6
%27 = icmp ne i32 %26, 0
br i1 %27, label %29, label %28
28: ; preds = %25
br label %58
29: ; preds = %25, %22, %19, %16, %12
%30 = load i32, i32* %2
%31 = load i32, i32* %5
%32 = mul nsw i32 %30, %31
%33 = sitofp i32 %32 to double
store double %33, double* %7
%34 = load i32, i32* %3
%35 = load i32, i32* %6
%36 = mul nsw i32 %34, %35
%37 = sitofp i32 %36 to double
store double %37, double* %8
%38 = load double, double* %7
%39 = load double, double* %7
%40 = load double, double* %8
%41 = load double, double* %8
%42 = fmul double %40, %41
%43 = call double @llvm.fmuladd.f64(double %38, double %39, double %42)
%44 = call double @sqrt(double %43)
store double %44, double* %9
%45 = load double, double* %9
%46 = load i32, i32* %4
%47 = sitofp i32 %46 to double
%48 = fdiv double %45, %47
store double %48, double* %10
%49 = load double, double* %7
%50 = load double, double* %9
%51 = fdiv double %49, %50
%52 = call double @acos(double %51)
%53 = fmul double 1.800000e+02, %52
%54 = fdiv double %53, 0x400921FB54442D18
store double %54, double* %11
%55 = load double, double* %11
%56 = load double, double* %10
%57 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), double %55, double %56)
br label %12
58: ; preds = %28
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"%d %d %d %d %d\00"
@.str.1 = [11 x i8] c"%.2f %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
br label %11
11: ; preds = %27, %0
%12 = call i32 @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4, i32* %5)
%13 = load i32, i32* %1
%14 = icmp ne i32 %13, 0
%15 = load i32, i32* %2
%16 = icmp ne i32 %15, 0
%17 = select i1 %14, i1 true, i1 %16
%18 = load i32, i32* %3
%19 = icmp ne i32 %18, 0
%20 = select i1 %17, i1 true, i1 %19
%21 = load i32, i32* %4
%22 = icmp ne i32 %21, 0
%23 = select i1 %20, i1 true, i1 %22
%24 = load i32, i32* %5
%25 = icmp ne i32 %24, 0
%26 = select i1 %23, i1 true, i1 %25
br i1 %26, label %27, label %43
27: ; preds = %11
%28 = mul nsw i32 %21, %13
%29 = sitofp i32 %28 to double
%30 = mul nsw i32 %24, %15
%31 = sitofp i32 %30 to double
%32 = fmul double %31, %31
%33 = call double @llvm.fmuladd.f64(double %29, double %29, double %32)
%34 = call double @sqrt(double %33)
%35 = load i32, i32* %3
%36 = sitofp i32 %35 to double
%37 = fdiv double %34, %36
%38 = fdiv double %29, %34
%39 = call double @acos(double %38)
%40 = fmul double %39, 1.800000e+02
%41 = fdiv double %40, 0x400921FB54442D18
%42 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), double %41, double %37)
br label %11
43: ; preds = %11
ret i32 0
}