#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*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, int *, int *, ...);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, const char *argv[]) {
  freopen("sun.in", "r", stdin);
  freopen("sun.out", "w", stdout);
  int n, m, i, j, k;
  double out = 0xffffff;
  scanf("%i %i", &n, &m);
  while (m--) {
    scanf("%i %i %i", &i, &j, &k);
    if (k < out)
      out = k;
  }
  printf("%.4lf", out);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
lea    0xeb2(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <freopen@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edx
lea    0xe9f(%rip),%rdi
lea    0xea0(%rip),%rsi
call   1040 <freopen@plt>
movsd  0xe7a(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    0xe8c(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
je     11f2 <main+0xc2>
lea    0xe5f(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
mov    $0x0,%al
call   1050 <scanf@plt>
cvtsi2sdl -0x24(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11ed <main+0xbd>
cvtsi2sdl -0x24(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    11a1 <main+0x71>
movsd  -0x30(%rbp),%xmm0
lea    0xe26(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    0x2ea6(%rip),%rax
mov    (%rax),%edx
lea    0xebd(%rip),%rdi
lea    0xebd(%rip),%rsi
call   1040 <freopen@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edx
lea    0xeaa(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1040 <freopen@plt>
lea    0xea4(%rip),%rdi
lea    0x24(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
subl   $0x1,0x8(%rsp)
jae    119c <main+0x6c>
movsd  0xe66(%rip),%xmm0
jmp    11f3 <main+0xc3>
movsd  0xe5c(%rip),%xmm1
lea    0xe70(%rip),%r14
lea    0x20(%rsp),%r15
lea    0x1c(%rsp),%r12
lea    0xc(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
movsd  %xmm1,0x10(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1050 <scanf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0xc(%rsp),%xmm0
minsd  0x10(%rsp),%xmm0
subl   $0x1,0x8(%rsp)
movapd %xmm0,%xmm1
jae    11c0 <main+0x90>
lea    0xe2a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"sun.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [8 x i8] c"sun.out\00"
@.str.3 = [2 x i8] c"w\00"
@stdout = global i32 0
@.str.4 = [6 x i8] c"%i %i\00"
@.str.5 = [9 x i8] c"%i %i %i\00"
@.str.6 = [6 x i8] c"%.4lf\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* @stdin
%13 = call i32 @freopen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* @stdout
%15 = call i32 @freopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %14)
store double 0x416FFFFFE0000000, double* %11
%16 = call i32 (i8*, i32*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32* %6, i32* %7)
br label %17
17: ; preds = %30, %2
%18 = load i32, i32* %7
%19 = add nsw i32 %18, -1
store i32 %19, i32* %7
%20 = icmp ne i32 %18, 0
br i1 %20, label %21, label %31
21: ; preds = %17
%22 = call i32 (i8*, i32*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32* %8, i32* %9, i32* %10)
%23 = load i32, i32* %10
%24 = sitofp i32 %23 to double
%25 = load double, double* %11
%26 = fcmp olt double %24, %25
br i1 %26, label %27, label %30
27: ; preds = %21
%28 = load i32, i32* %10
%29 = sitofp i32 %28 to double
store double %29, double* %11
br label %30
30: ; preds = %27, %21
br label %17
31: ; preds = %17
%32 = load double, double* %11
%33 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double %32)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"sun.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [8 x i8] c"sun.out\00"
@.str.3 = [2 x i8] c"w\00"
@stdout = global i32 0
@.str.4 = [6 x i8] c"%i %i\00"
@.str.5 = [9 x i8] c"%i %i %i\00"
@.str.6 = [6 x i8] c"%.4lf\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = load i32, i32* @stdin
%9 = tail call i32 @freopen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @stdout
%11 = tail call i32 @freopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = bitcast i32* %3 to i8*
%13 = bitcast i32* %4 to i8*
%14 = bitcast i32* %5 to i8*
%15 = bitcast i32* %6 to i8*
%16 = bitcast i32* %7 to i8*
%17 = call i32 (i8*, i32*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32* %3, i32* %4)
%18 = load i32, i32* %4
%19 = add nsw i32 %18, -1
store i32 %19, i32* %4
%20 = icmp eq i32 %18, 0
br i1 %20, label %31, label %21
21: ; preds = %2, %21
%22 = phi double [ %27, %21 ], [ 0x416FFFFFE0000000, %2 ]
%23 = call i32 (i8*, i32*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32* %5, i32* %6, i32* %7)
%24 = load i32, i32* %7
%25 = sitofp i32 %24 to double
%26 = fcmp ogt double %22, %25
%27 = select i1 %26, double %25, double %22
%28 = load i32, i32* %4
%29 = add nsw i32 %28, -1
store i32 %29, i32* %4
%30 = icmp eq i32 %28, 0
br i1 %30, label %31, label %21
31: ; preds = %21, %2
%32 = phi double [ 0x416FFFFFE0000000, %2 ], [ %27, %21 ]
%33 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double %32)
ret i32 0
}