#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 *, long long);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main(void) {
  int ladoDoVermelho, ladoDoVerde, ladoDoAzul;
  long long int quantidadeDeVermelho, quantidadeDeVerde, quantidadeDeAzul;
  scanf("%x %x %x", &ladoDoVermelho, &ladoDoVerde, &ladoDoAzul);
  quantidadeDeVermelho = 1;
  quantidadeDeVerde = ladoDoVermelho / ladoDoVerde;
  quantidadeDeVerde *= quantidadeDeVerde;
  quantidadeDeAzul = ladoDoVerde / ladoDoAzul;
  quantidadeDeAzul *= quantidadeDeAzul;
  quantidadeDeAzul *= quantidadeDeVerde;
  printf("%llx\n", quantidadeDeVermelho + quantidadeDeVerde + quantidadeDeAzul);
  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
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
movq   $0x1,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
imul   -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cltq
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
imul   -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
imul   -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rsi
add    -0x20(%rbp),%rsi
add    -0x28(%rbp),%rsi
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
mov    0x10(%rsp),%ecx
cltd
idiv   %ecx
movslq %eax,%rsi
imul   %rsi,%rsi
mov    %ecx,%eax
cltd
idivl  0xc(%rsp)
cltq
mov    %rsi,%rcx
imul   %rax,%rcx
imul   %rax,%rcx
add    %rcx,%rsi
add    $0x1,%rsi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%x %x %x\00"
@.str.1 = [6 x i8] c"%llx\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
store i64 1, i64* %5
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = sdiv i32 %9, %10
%12 = sext i32 %11 to i64
store i64 %12, i64* %6
%13 = load i64, i64* %6
%14 = load i64, i64* %6
%15 = mul nsw i64 %14, %13
store i64 %15, i64* %6
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = sdiv i32 %16, %17
%19 = sext i32 %18 to i64
store i64 %19, i64* %7
%20 = load i64, i64* %7
%21 = load i64, i64* %7
%22 = mul nsw i64 %21, %20
store i64 %22, i64* %7
%23 = load i64, i64* %6
%24 = load i64, i64* %7
%25 = mul nsw i64 %24, %23
store i64 %25, i64* %7
%26 = load i64, i64* %5
%27 = load i64, i64* %6
%28 = add nsw i64 %26, %27
%29 = load i64, i64* %7
%30 = add nsw i64 %28, %29
%31 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%x %x %x\00"
@.str.1 = [6 x i8] c"%llx\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = sdiv i32 %8, %9
%11 = sext i32 %10 to i64
%12 = mul nsw i64 %11, %11
%13 = load i32, i32* %3
%14 = sdiv i32 %9, %13
%15 = sext i32 %14 to i64
%16 = mul i64 %12, %15
%17 = mul i64 %16, %15
%18 = add nuw nsw i64 %12, 1
%19 = add nuw nsw i64 %18, %17
%20 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %19)
ret i32 0
}