From d90961f2d142b5bb504d84c2830d56fac70f87a6 Mon Sep 17 00:00:00 2001 From: oncsr Date: Sat, 7 Jun 2025 00:49:04 +0900 Subject: [PATCH] =?UTF-8?q?[20250607]=20SWEA=20/=20D3=20/=20=EA=B3=B5?= =?UTF-8?q?=EA=B3=BC=20=EC=83=81=EC=9E=90=20/=20=EA=B6=8C=ED=98=81?= =?UTF-8?q?=EC=A4=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...5\352\263\274 \354\203\201\354\236\220.md" | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 "khj20006/202506/07 SWEA D3 \352\263\265\352\263\274 \354\203\201\354\236\220.md" diff --git "a/khj20006/202506/07 SWEA D3 \352\263\265\352\263\274 \354\203\201\354\236\220.md" "b/khj20006/202506/07 SWEA D3 \352\263\265\352\263\274 \354\203\201\354\236\220.md" new file mode 100644 index 00000000..74c8e6a6 --- /dev/null +++ "b/khj20006/202506/07 SWEA D3 \352\263\265\352\263\274 \354\203\201\354\236\220.md" @@ -0,0 +1,80 @@ +```java +import java.util.*; +import java.io.*; + +class IOController { + BufferedReader br; + BufferedWriter bw; + StringTokenizer st; + + public IOController(){ + br = new BufferedReader(new InputStreamReader(System.in)); + bw = new BufferedWriter(new OutputStreamWriter(System.out)); + st = new StringTokenizer(""); + } + + void nextLine() throws Exception { + st = new StringTokenizer(br.readLine()); + } + + String nextToken() throws Exception { + while(!st.hasMoreTokens()) nextLine(); + return st.nextToken(); + } + + int nextInt() throws Exception { return Integer.parseInt(nextToken()); } + long nextLong() throws Exception { return Long.parseLong(nextToken()); } + double nextDouble() throws Exception { return Double.parseDouble(nextToken()); } + + void close() throws Exception { + bw.flush(); + bw.close(); + } + + void write(String content) throws Exception { + bw.write(content); + } + +} + +public class Solution { + + static IOController io; + + // + + static int B, W, X, Y, Z; + + public static void main(String[] args) throws Exception { + + io = new IOController(); + + for(int T = io.nextInt();T-->0;solve()) input(); + + io.close(); + + } + + public static void input() throws Exception { + + B = io.nextInt(); + W = io.nextInt(); + X = io.nextInt(); + Y = io.nextInt(); + Z = io.nextInt(); + + } + + static void solve() throws Exception { + + int res = -(int)1e9; + for(int c=0;c<=Math.min(B,W);c++) { + res = Math.max(res, B*X + W*Y - c*(X+Y) + 2*c*Z); + } + io.write(res + "\n"); + + } + + +} +```