#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*/ scanf(char *, int *, ...);
int /*<<< orphan*/ sort(int *, int, long long);
int main() {
  int n, k, s;
  scanf("%d%d%d", &n, &k, &s);
  long long int sum = 0;
  long long int scr = (k * s);
  int a[n], i;
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a, n, scr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
xor    %eax,%eax
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
movq   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
imul   %ecx,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c5 <main+0xa5>
mov    -0x40(%rbp),%rsi
movslq -0x34(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    118e <main+0x6e>
mov    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <sort@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xec8(%rip),%rdi
lea    -0x2c(%rbp),%rsi
lea    -0x34(%rbp),%rdx
lea    -0x30(%rbp),%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rsp,%rbx
movslq -0x34(%rbp),%rcx
movslq -0x30(%rbp),%r14
mov    -0x2c(%rbp),%eax
mov    %rsp,%r15
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
mov    -0x2c(%rbp),%esi
test   %esi,%esi
jle    11b6 <main+0x96>
mov    %rcx,-0x40(%rbp)
mov    %rbx,-0x48(%rbp)
lea    0xe80(%rip),%r12
mov    %r15,%rbx
xor    %r13d,%r13d
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
add    $0x1,%r13
movslq -0x2c(%rbp),%rsi
add    $0x4,%rbx
cmp    %rsi,%r13
jl     1190 <main+0x70>
mov    -0x48(%rbp),%rbx
mov    -0x40(%rbp),%rcx
imul   %rcx,%r14
mov    %r15,%rdi
mov    %r14,%rdx
call   1030 <sort@plt>
mov    %rbx,%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
store i32 0, i32* %1
%10 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
store i64 0, i64* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = mul nsw i32 %11, %12
%14 = sext i32 %13 to i64
store i64 %14, i64* %6
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = call i8* @llvm.stacksave()
store i8* %17, i8** %7
%18 = alloca i32, i64 %16
store i64 %16, i64* %8
store i32 0, i32* %9
br label %19
19: ; preds = %28, %0
%20 = load i32, i32* %9
%21 = load i32, i32* %2
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %31
23: ; preds = %19
%24 = load i32, i32* %9
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %18, i64 %25
%27 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %26)
br label %28
28: ; preds = %23
%29 = load i32, i32* %9
%30 = add nsw i32 %29, 1
store i32 %30, i32* %9
br label %19
31: ; preds = %19
%32 = load i32, i32* %2
%33 = load i64, i64* %6
%34 = call i32 @sort(i32* %18, i32 %32, i64 %33)
store i32 0, i32* %1
%35 = load i8*, i8** %7
%36 = load i32, i32* %1
ret i32 %36
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d%d%d\00"
@.str.1 = [3 x i8] c"%d\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 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = load i32, i32* %1
%11 = zext i32 %10 to i64
%12 = call i8* @llvm.stacksave()
%13 = alloca i32, i64 %11
%14 = load i32, i32* %1
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %24
16: ; preds = %0, %16
%17 = phi i64 [ %20, %16 ], [ 0, %0 ]
%18 = getelementptr inbounds i32, i32* %13, i64 %17
%19 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %18)
%20 = add nuw nsw i64 %17, 1
%21 = load i32, i32* %1
%22 = sext i32 %21 to i64
%23 = icmp slt i64 %20, %22
br i1 %23, label %16, label %24
24: ; preds = %16, %0
%25 = phi i32 [ %14, %0 ], [ %21, %16 ]
%26 = mul nsw i32 %9, %8
%27 = sext i32 %26 to i64
%28 = call i32 @sort(i32* %13, i32 %25, i64 %27)
ret i32 0
}