File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed
Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ ``` java
2+
3+ import java.util.* ;
4+ import java.io.* ;
5+
6+
7+ class Main {
8+
9+ // IO field
10+ static BufferedReader br = new BufferedReader (new InputStreamReader (System . in));
11+ static BufferedWriter bw = new BufferedWriter (new OutputStreamWriter (System . out));
12+ static StringTokenizer st;
13+
14+ static void nextLine () throws Exception {st = new StringTokenizer (br .readLine ());}
15+ static int nextInt() {return Integer . parseInt(st. nextToken());}
16+ static long nextLong() {return Long . parseLong(st. nextToken());}
17+ static void bwEnd() throws Exception {bw. flush();bw. close();}
18+
19+ // Additional field
20+ static long [] D ;
21+ static int N ;
22+
23+ public static void main(String [] args) throws Exception {
24+
25+ ready();
26+ solve();
27+
28+ bwEnd();
29+
30+ }
31+
32+ static void ready() throws Exception {
33+
34+ N = Integer . parseInt(br. readLine());
35+ D = new long [1000001 ];
36+
37+ }
38+
39+ static void solve() throws Exception {
40+
41+ for (int i= 1 ;i<= 5 ;i++ ) D [i] = i;
42+ D [6 ] = 7 ;
43+ for (int i= 7 ;i<= N ;i++ ) D [i] = D [i- 6 ] + i;
44+ bw. write(D [N ] + " \n " );
45+
46+ }
47+
48+ }
49+
50+ ```
You can’t perform that action at this time.
0 commit comments