diff --git "a/lkhyun/202510/12 BOJ G5 \353\213\244\354\235\264\354\226\264\355\212\270.md" "b/lkhyun/202510/12 BOJ G5 \353\213\244\354\235\264\354\226\264\355\212\270.md" new file mode 100644 index 00000000..00c9c15d --- /dev/null +++ "b/lkhyun/202510/12 BOJ G5 \353\213\244\354\235\264\354\226\264\355\212\270.md" @@ -0,0 +1,41 @@ +```java +import java.util.*; +import java.io.*; + +public class Main{ + static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); + static StringBuilder sb = new StringBuilder(); + static int G; + + public static void main(String[] args) throws Exception { + G = Integer.parseInt(br.readLine()); + List results = new ArrayList<>(); + for (int b = 1; b * b <= G; b++) { + if (G % b == 0) { + int a = G / b; + + if ((a + b) % 2 == 0) { + int c = (a + b) / 2; + int p = (a - b) / 2; + + if (p >= 1) { + results.add(c); + } + } + } + } + + if (results.isEmpty()) { + bw.write("-1"); + } else { + Collections.sort(results); + for (int weight : results) { + bw.write(weight + "\n"); + } + } + + bw.close(); + } +} +```