#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);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main() {
  int d = 200, n, m, k, h, i;
  scanf("%d %d %d\n", &n, &m, &k);
  for (i = 1; i <= n; ++i) {
    scanf("%d", &h);
    if (h && h <= k && d > ((i - m) > 0 ? (i - m) : -(i - m)))
      d = ((i - m) > 0 ? (i - m) : -(i - m));
  }
  printf("%d", d * 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc8,-0x8(%rbp)
lea    0xec3(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     120c <main+0xec>
lea    0xea0(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x0,-0x18(%rbp)
je     11f9 <main+0xd9>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11f9 <main+0xd9>
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
sub    -0x10(%rbp),%eax
cmp    $0x0,%eax
jle    11ae <main+0x8e>
mov    -0x1c(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    11bb <main+0x9b>
mov    -0x1c(%rbp),%ecx
sub    -0x10(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x24(%rbp),%ecx
cmp    %ecx,%eax
jle    11f9 <main+0xd9>
mov    -0x1c(%rbp),%eax
sub    -0x10(%rbp),%eax
cmp    $0x0,%eax
jle    11e6 <main+0xc6>
mov    -0x1c(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    11f3 <main+0xd3>
mov    -0x1c(%rbp),%ecx
sub    -0x10(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    11fe <main+0xde>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1157 <main+0x37>
imul   $0xa,-0x8(%rbp),%esi
lea    0xdf3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xecf(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    11ab <main+0x8b>
mov    $0xc8,%ebx
lea    0xeb0(%rip),%r14
lea    0xc(%rsp),%r15
xor    %ebp,%ebp
jmp    1179 <main+0x59>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jge    11b0 <main+0x90>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
je     1170 <main+0x50>
cmp    0x10(%rsp),%eax
jg     1170 <main+0x50>
mov    %ebp,%eax
sub    0x14(%rsp),%eax
add    $0x1,%eax
mov    %eax,%ecx
neg    %ecx
cmovs  %eax,%ecx
cmp    %ecx,%ebx
cmovg  %ecx,%ebx
jmp    1170 <main+0x50>
mov    $0xc8,%ebx
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%esi
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\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 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%10 = load i32, i32* %1
%11 = icmp slt i32 %10, 1
br i1 %11, label %32, label %12
12: ; preds = %0, %27
%13 = phi i32 [ %29, %27 ], [ 1, %0 ]
%14 = phi i32 [ %28, %27 ], [ 200, %0 ]
%15 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 0
%18 = load i32, i32* %3
%19 = icmp sgt i32 %16, %18
%20 = select i1 %17, i1 true, i1 %19
br i1 %20, label %27, label %21
21: ; preds = %12
%22 = load i32, i32* %2
%23 = sub nsw i32 %13, %22
%24 = call i32 @llvm.abs.i32(i32 %23, i1 true)
%25 = icmp sgt i32 %14, %24
%26 = select i1 %25, i32 %24, i32 %14
br label %27
27: ; preds = %21, %12
%28 = phi i32 [ %14, %12 ], [ %26, %21 ]
%29 = add nuw nsw i32 %13, 1
%30 = load i32, i32* %1
%31 = icmp slt i32 %13, %30
br i1 %31, label %12, label %32
32: ; preds = %27, %0
%33 = phi i32 [ 200, %0 ], [ %28, %27 ]
%34 = mul nsw i32 %33, 10
%35 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %34)
ret i32 0
}