#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 *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int t, pa, pb, i, anos = 0;
  double g1, g2;
  scanf("%d", &t);
  if (1 <= t && t <= 3000) {
    for (i = 1; i <= t; i++) {
      scanf("%d", &pa);
      scanf("%d", &pb);
      scanf("%lf", &g1);
      scanf("%lf", &g2);
      while (pa <= pb) {
        pa = pa * (100 + g1) / 100;
        pb = pb * (100 + g2) / 100;
        anos++;
        if (anos > 100)
          break;
      }
      if (anos <= 100)
        printf("%d anos.\n", anos);
      else
        printf("Mais de 1 seculo.\n");
      anos = 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jg     1281 <main+0x161>
cmpl   $0xbb8,-0x8(%rbp)
jg     1281 <main+0x161>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     127c <main+0x15c>
lea    0xe8b(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe79(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe6a(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe58(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1239 <main+0x119>
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xe29(%rip),%xmm1
addsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe18(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  0xe00(%rip),%xmm1
addsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdef(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x64,-0x18(%rbp)
jle    1234 <main+0x114>
jmp    1239 <main+0x119>
jmp    11be <main+0x9e>
cmpl   $0x64,-0x18(%rbp)
jg     1259 <main+0x139>
mov    -0x18(%rbp),%esi
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1267 <main+0x147>
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116a <main+0x4a>
jmp    1281 <main+0x161>
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    0x14(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    $0xfffff447,%eax
add    0x14(%rsp),%eax
cmp    $0xfffff448,%eax
jae    1172 <main+0x42>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%r14d
lea    0xe91(%rip),%r12
lea    0xc(%rsp),%r15
lea    0xe88(%rip),%rbx
lea    0x20(%rsp),%r13
lea    0x18(%rsp),%rbp
jmp    11bc <main+0x8c>
nopw   0x0(%rax,%rax,1)
lea    0xe70(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1(%r14),%eax
cmp    0x14(%rsp),%r14d
mov    %eax,%r14d
jge    1161 <main+0x31>
mov    %r12,%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movsd  0x18(%rsp),%xmm0
movhpd 0x20(%rsp),%xmm0
movapd 0xdfa(%rip),%xmm3
addpd  %xmm3,%xmm0
movd   0x10(%rsp),%xmm2
movd   0xc(%rsp),%xmm1
punpckldq %xmm2,%xmm1
xor    %esi,%esi
nopl   0x0(%rax)
pshufd $0x55,%xmm1,%xmm2
pcmpgtd %xmm1,%xmm2
movd   %xmm2,%eax
test   $0x1,%al
jne    11a0 <main+0x70>
cvtdq2pd %xmm1,%xmm1
mulpd  %xmm0,%xmm1
divpd  %xmm3,%xmm1
cvttpd2dq %xmm1,%xmm1
pshufd $0x55,%xmm1,%xmm2
movd   %xmm2,0x10(%rsp)
movd   %xmm1,0xc(%rsp)
add    $0x1,%esi
cmp    $0x65,%esi
jne    1220 <main+0xf0>
lea    0xdbc(%rip),%rdi
call   1030 <puts@plt>
jmp    11ae <main+0x7e>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [10 x i8] c"%d anos.\0A\00"
@.str.3 = [19 x i8] c"Mais de 1 seculo.\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
store i32 0, i32* %1
store i32 0, i32* %6
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = icmp sle i32 1, %10
br i1 %11, label %12, label %63
12: ; preds = %0
%13 = load i32, i32* %2
%14 = icmp sle i32 %13, 3000
br i1 %14, label %15, label %63
15: ; preds = %12
store i32 1, i32* %5
br label %16
16: ; preds = %59, %15
%17 = load i32, i32* %5
%18 = load i32, i32* %2
%19 = icmp sle i32 %17, %18
br i1 %19, label %20, label %62
20: ; preds = %16
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %7)
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %8)
br label %25
25: ; preds = %49, %20
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = icmp sle i32 %26, %27
br i1 %28, label %29, label %50
29: ; preds = %25
%30 = load i32, i32* %3
%31 = sitofp i32 %30 to double
%32 = load double, double* %7
%33 = fadd double 1.000000e+02, %32
%34 = fmul double %31, %33
%35 = fdiv double %34, 1.000000e+02
%36 = fptosi double %35 to i32
store i32 %36, i32* %3
%37 = load i32, i32* %4
%38 = sitofp i32 %37 to double
%39 = load double, double* %8
%40 = fadd double 1.000000e+02, %39
%41 = fmul double %38, %40
%42 = fdiv double %41, 1.000000e+02
%43 = fptosi double %42 to i32
store i32 %43, i32* %4
%44 = load i32, i32* %6
%45 = add nsw i32 %44, 1
store i32 %45, i32* %6
%46 = load i32, i32* %6
%47 = icmp sgt i32 %46, 100
br i1 %47, label %48, label %49
48: ; preds = %29
br label %50
49: ; preds = %29
br label %25
50: ; preds = %48, %25
%51 = load i32, i32* %6
%52 = icmp sle i32 %51, 100
br i1 %52, label %53, label %56
53: ; preds = %50
%54 = load i32, i32* %6
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %54)
br label %58
56: ; preds = %50
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
br label %58
58: ; preds = %56, %53
store i32 0, i32* %6
br label %59
59: ; preds = %58
%60 = load i32, i32* %5
%61 = add nsw i32 %60, 1
store i32 %61, i32* %5
br label %16
62: ; preds = %16
br label %63
63: ; preds = %62, %12, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [10 x i8] c"%d anos.\0A\00"
@str = [18 x i8] c"Mais de 1 seculo.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast double* %4 to i8*
%10 = bitcast double* %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 i32 %12, -3001
%14 = icmp ult i32 %13, -3000
br i1 %14, label %53, label %15
15: ; preds = %0, %49
%16 = phi i32 [ %50, %49 ], [ 1, %0 ]
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %4)
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %5)
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = load double, double* %4
%24 = load double, double* %5
%25 = insertelement <2 x double> poison, double %24, i64 0
%26 = insertelement <2 x double> %25, double %23, i64 1
%27 = fadd <2 x double> %26, <double 1.000000e+02, double 1.000000e+02>
%28 = insertelement <2 x i32> poison, i32 %22, i64 0
%29 = insertelement <2 x i32> %28, i32 %21, i64 1
br label %30
30: ; preds = %36, %15
%31 = phi i32 [ 0, %15 ], [ %43, %36 ]
%32 = phi <2 x i32> [ %29, %15 ], [ %40, %36 ]
%33 = shufflevector <2 x i32> %32, <2 x i32> poison, <2 x i32> <i32 1, i32 undef>
%34 = icmp sgt <2 x i32> %33, %32
%35 = extractelement <2 x i1> %34, i64 0
br i1 %35, label %45, label %36
36: ; preds = %30
%37 = sitofp <2 x i32> %32 to <2 x double>
%38 = fmul <2 x double> %27, %37
%39 = fdiv <2 x double> %38, <double 1.000000e+02, double 1.000000e+02>
%40 = fptosi <2 x double> %39 to <2 x i32>
%41 = extractelement <2 x i32> %40, i64 1
store i32 %41, i32* %2
%42 = extractelement <2 x i32> %40, i64 0
store i32 %42, i32* %3
%43 = add nuw nsw i32 %31, 1
%44 = icmp eq i32 %43, 101
br i1 %44, label %47, label %30
45: ; preds = %30
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %31)
br label %49
47: ; preds = %36
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %49
49: ; preds = %47, %45
%50 = add nuw nsw i32 %16, 1
%51 = load i32, i32* %1
%52 = icmp slt i32 %16, %51
br i1 %52, label %15, label %53
53: ; preds = %49, %0
ret i32 0
}