Skip to content

Commit

Permalink
Create S4_9507
Browse files Browse the repository at this point in the history
  • Loading branch information
RangKoon authored Jul 7, 2024
1 parent 0a0c2c4 commit d8ea9eb
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions 진민혁/S4_9507
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import java.util.*;
import java.io.*;

public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
StringBuilder sb = new StringBuilder();
long[] arr = new long[70];
arr[0] = arr[1] = 1;
arr[2] = 2;
arr[3] = 4;
for(int i=4; i<70; i++) {
arr[i] = arr[i-1] + arr[i-2] + arr[i-3] + arr[i-4];
}
for(int i=0; i<t; i++) {
int n = Integer.parseInt(br.readLine());
sb.append(arr[n] + "\n");
}
System.out.println(sb);
}
}

0 comments on commit d8ea9eb

Please sign in to comment.