From 5474f3197335fd4647dc7c5353638bfeddf2008b Mon Sep 17 00:00:00 2001 From: oncsr Date: Mon, 17 Mar 2025 17:37:21 +0900 Subject: [PATCH] =?UTF-8?q?[20250317]=20BOJ=20/=20G4=20/=201=EA=B3=BC=205?= =?UTF-8?q?=20/=20=EA=B6=8C=ED=98=81=EC=A4=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../202503/17 BOJ G4 1\352\263\274 5.md" | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 "khj20006/202503/17 BOJ G4 1\352\263\274 5.md" diff --git "a/khj20006/202503/17 BOJ G4 1\352\263\274 5.md" "b/khj20006/202503/17 BOJ G4 1\352\263\274 5.md" new file mode 100644 index 00000000..82bb2e13 --- /dev/null +++ "b/khj20006/202503/17 BOJ G4 1\352\263\274 5.md" @@ -0,0 +1,73 @@ +```java + +import java.util.*; +import java.io.*; + +class Main { + + // IO field + static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); + static StringTokenizer st = new StringTokenizer(""); + + static void nextLine() throws Exception {st = new StringTokenizer(br.readLine());} + static int nextInt() throws Exception { + if(!st.hasMoreTokens()) nextLine(); + return Integer.parseInt(st.nextToken()); + } + static long nextLong() throws Exception { + if(!st.hasMoreTokens()) nextLine(); + return Long.parseLong(st.nextToken()); + } + static void bwEnd() throws Exception {bw.flush();bw.close();} + + // Additional field + + static int T; + static char[] N; + + public static void main(String[] args) throws Exception { + + T = nextInt(); + while(T-->0) { + + ready(); + solve(); + } + + bwEnd(); + + } + + static void ready() throws Exception{ + + N = br.readLine().toCharArray(); + + } + + static void solve() throws Exception{ + + if(N[N.length-1] == '5') bw.write("0 5\n"); + else { + int sum = 0, pos1 = 0, pos5 = -1; + for(int i=0;i