@@ -0,0 +1,762 @@
+package boj_2355;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.InputStreamReader;%0Aimport java.util.StringTokenizer;%0A%0A/**%0A * %EB%B0%B1%EC%A4%80 %EC%98%A8%EB%9D%BC%EC%9D%B8 %EC%A0%80%EC%A7%80 2355%EB%B2%88 (%EC%8B%9C%EA%B7%B8%EB%A7%88) %EB%AC%B8%EC%A0%9C%ED%92%80%EC%9D%B4%0A *%0A * @see https://www.acmicpc.net/problem/2355%0A * @author devetude%0A */%0Apublic class Main %7B%0A%09public static void main(String args%5B%5D) throws Exception %7B%0A%09%09// %EB%B2%84%ED%8D%BC%EB%A5%BC %ED%86%B5%ED%95%B4 %EC%9E%85%EB%A0%A5 %EA%B0%92%EC%9D%84 %EB%B0%9B%EC%9D%8C%0A%09%09BufferedReader br = new BufferedReader(new InputStreamReader(System.in));%0A%09%09StringTokenizer st = new StringTokenizer(br.readLine(), %22 %22);%0A%09%09long i = Long.parseLong(st.nextToken());%0A%09%09long j = Long.parseLong(st.nextToken());%0A%09%09br.close();%0A%0A%09%09// %EC%95%9E%EC%97%90%EC%84%9C %EC%9E%85%EB%A0%A5%EB%B0%9B%EC%9D%80 %EC%88%AB%EC%9E%90%EA%B0%80 %EB%8D%94 %ED%81%B0 %EA%B2%BD%EC%9A%B0 %EC%95%9E%EB%92%A4 %EC%88%AB%EC%9E%90%EB%A5%BC %EB%B3%80%EA%B2%BD%0A%09%09if (i %3E j) %7B%0A%09%09%09long tmp = i;%0A%09%09%09i = j;%0A%09%09%09j = tmp;%0A%09%09%7D%0A%0A%09%09// %EA%B2%B0%EA%B3%BC %EA%B0%92 %EC%B6%9C%EB%A0%A5%0A%09%09// %EB%93%B1%EC%B0%A8%EC%88%98%EC%97%B4%EC%9D%98 %ED%95%A9 %EA%B3%B5%EC%8B%9D : n * (a + l) / 2%0A%09%09System.out.println((j - i + 1L) * (i + j) / 2L);%0A%09%7D%0A%7D

add problem 2355