diff --git "a/suyeun84/202508/08 BOJ G5 1, 2, 3 \353\215\224\355\225\230\352\270\260 4.md" "b/suyeun84/202508/08 BOJ G5 1, 2, 3 \353\215\224\355\225\230\352\270\260 4.md" new file mode 100644 index 00000000..a0aa3b26 --- /dev/null +++ "b/suyeun84/202508/08 BOJ G5 1, 2, 3 \353\215\224\355\225\230\352\270\260 4.md" @@ -0,0 +1,28 @@ +```java +import java.io.*; +import java.util.*; + +public class boj15989 { + static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + static StringTokenizer st; + static void nextLine() throws Exception {st = new StringTokenizer(br.readLine());} + static int nextInt() {return Integer.parseInt(st.nextToken());} + + public static void main(String[] args) throws Exception { + nextLine(); + int T = nextInt(); + for (int tc = 0; tc < T; tc++) { + nextLine(); + int n = nextInt(); + int[] dp = new int[n+1]; + dp[0] = 1; + for (int i = 1; i <= 3; i++) { + for (int j = i; j <= n; j++) { + dp[j] += dp[j-i]; + } + } + System.out.println(dp[n]); + } + } +} +```