program yuki851 implicit none integer(8) :: n, i, c integer(8), allocatable :: a(:), b(:) read(*,*) n ! n=3 allocate(a(n), b(n)) c = 0 read(*, *) a(1), c if (c >= 1) then write(*,*) "assert" stop end if do i = 2, n read(*,*) a(i) end do b(1) = a(2)+a(3) b(2) = a(1)+a(3) b(3) = a(2)+a(1) write(*,*) sum(b)- maxval(b) + minval(b) end program yuki851