From a97d9b6cb0ff1428bef0795e2050382037252cf2 Mon Sep 17 00:00:00 2001 From: hi-june Date: Wed, 5 Jul 2023 21:24:26 +0900 Subject: [PATCH] =?UTF-8?q?16=EC=A3=BC=EC=B0=A8=2020115=EB=B2=88=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=ED=92=80=EC=9D=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...65\234\354\244\200\355\230\201_20115.java" | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 "week16/BOJ_1_20115/\354\265\234\354\244\200\355\230\201_20115.java" diff --git "a/week16/BOJ_1_20115/\354\265\234\354\244\200\355\230\201_20115.java" "b/week16/BOJ_1_20115/\354\265\234\354\244\200\355\230\201_20115.java" new file mode 100644 index 0000000..d94ddbd --- /dev/null +++ "b/week16/BOJ_1_20115/\354\265\234\354\244\200\355\230\201_20115.java" @@ -0,0 +1,32 @@ +package week16.BOJ_1_20115; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public class 최준혁_20115 { + public static void main(String[] args) throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + + int N = Integer.parseInt(br.readLine()); + + List drinks = Arrays.stream(br.readLine().split(" ")) + .map(Double::valueOf) + .collect(Collectors.toList()); + + Double max = Collections.max(drinks); + drinks.remove(max); + + double total = max; + + for (double i : drinks) { + total += (i / 2); + } + + System.out.println(total); + } +}