#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 */
int /*<<< orphan*/ printf(char *, unsigned long long, unsigned long long);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int n;
  long long unsigned int a, b, c, d;
  long long unsigned int result;
  scanf("%d", &n);
  while (n--) {
    scanf("%llu%llu%llu%llu", &a, &b, &c, &d);
    result = ((d - b) * 100) / (c - a);
    printf("%llu,%02llu\n", result / 100, result % 100);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     11c0 <main+0xa0>
lea    0xea7(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x28(%rbp),%rax
sub    -0x18(%rbp),%rax
imul   $0x64,%rax,%rax
mov    -0x20(%rbp),%rcx
sub    -0x10(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    $0x64,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rsi
mov    -0x30(%rbp),%rax
mov    $0x64,%ecx
xor    %edx,%edx
div    %rcx
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
jmp    1141 <main+0x21>
xor    %eax,%eax
add    $0x30,%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    0xecb(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subl   $0x1,0x4(%rsp)
jae    1159 <main+0x39>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x20(%rsp),%r15
lea    0x18(%rsp),%r12
lea    0x10(%rsp),%r13
lea    0x8(%rsp),%rbx
movabs $0x28f5c28f5c28f5c3,%r14
c2 f5 28
lea    0xe96(%rip),%rbp
jmp    11b2 <main+0x92>
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    %rcx,%rax
shr    $0x2,%rax
mul    %r14
shr    $0x2,%rdx
imul   $0x64,%rdx,%rax
sub    %rax,%rcx
mov    %rbp,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1030 <printf@plt>
subl   $0x1,0x4(%rsp)
jb     1148 <main+0x28>
lea    0xe4a(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%rax
sub    0x18(%rsp),%rax
imul   $0x64,%rax,%rax
mov    0x10(%rsp),%rcx
sub    0x20(%rsp),%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1180 <main+0x60>
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
jmp    1188 <main+0x68>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [17 x i8] c"%llu%llu%llu%llu\00"
@.str.2 = [13 x i8] c"%llu,%02llu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %9
9: ; preds = %13, %0
%10 = load i32, i32* %2
%11 = add nsw i32 %10, -1
store i32 %11, i32* %2
%12 = icmp ne i32 %10, 0
br i1 %12, label %13, label %28
13: ; preds = %9
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i64* %3, i64* %4, i64* %5, i64* %6)
%15 = load i64, i64* %6
%16 = load i64, i64* %4
%17 = sub i64 %15, %16
%18 = mul i64 %17, 100
%19 = load i64, i64* %5
%20 = load i64, i64* %3
%21 = sub i64 %19, %20
%22 = udiv i64 %18, %21
store i64 %22, i64* %7
%23 = load i64, i64* %7
%24 = udiv i64 %23, 100
%25 = load i64, i64* %7
%26 = urem i64 %25, 100
%27 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i64 %24, i64 %26)
br label %9
28: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [17 x i8] c"%llu%llu%llu%llu\00"
@.str.2 = [13 x i8] c"%llu,%02llu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = bitcast i32* %1 to i8*
%7 = bitcast i64* %2 to i8*
%8 = bitcast i64* %3 to i8*
%9 = bitcast i64* %4 to i8*
%10 = bitcast i64* %5 to i8*
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%12 = load i32, i32* %1
%13 = add nsw i32 %12, -1
store i32 %13, i32* %1
%14 = icmp eq i32 %12, 0
br i1 %14, label %31, label %15
15: ; preds = %0, %15
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i64* %2, i64* %3, i64* %4, i64* %5)
%17 = load i64, i64* %5
%18 = load i64, i64* %3
%19 = sub i64 %17, %18
%20 = mul i64 %19, 100
%21 = load i64, i64* %4
%22 = load i64, i64* %2
%23 = sub i64 %21, %22
%24 = udiv i64 %20, %23
%25 = udiv i64 %24, 100
%26 = urem i64 %24, 100
%27 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i64 %25, i64 %26)
%28 = load i32, i32* %1
%29 = add nsw i32 %28, -1
store i32 %29, i32* %1
%30 = icmp eq i32 %28, 0
br i1 %30, label %31, label %15
31: ; preds = %15, %0
ret i32 0
}