Language: C++

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;
 
 
 
 
public class Main {
    ArrayList<Integer>[] graph;
    boolean[] vis;
    int[] cost;
    queue q = new queue((int)1e6);
    public static void main(String[] args) throws IOException {
        Reader.init(System.in);
        new Main();
    }
 
    Main() throws IOException {
        solve();
    }
 
    void solve() throws IOException {
        Reader.init(System.in);
        int N = Reader.nextInt();
        int K = Reader.nextInt();
        int c1 = N/K;
        if((K&1) == 1){System.out.println((c1*(c1)*(c1)));}
        else{
            int c2 = N/K;
            if(N%K >= K/2 && K/2 != 0){c2 += 1;}
            System.out.println(((c1)*(c1)*(c1)) + (c2*c2*c2));
        }
    }
 
}
 
class queue{
    int front;
    int rear;
    int[] array;
    int capacity;
    int size;
    queue(int cap){
        front = rear = -1;
        array = new int[cap+1];
        capacity = cap;
        size = 0;
    }
 
    void enqueue(int x){
        if(front == -1){
            array[++front] = x;
            rear++;
            size++;
            return;
        }
        else{
            array[++rear] = x;
            size++;
        }
    }
 
    int dequeue(){
        if(size == 0){return -1;}
        if(front == rear){
            int out = array[front];
            front = rear = -1;
            size--;
            return out;
        }
        else{
            size--;
            return array[front++];
        }
    }
}
 
class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;
    /** call this method to initialize reader for InputStream */
 
    static void init(InputStream input) {
        reader = new BufferedReader(new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
 
    }
 
    static String nextToken() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
 
                tokenizer = new StringTokenizer(reader.readLine());
 
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }
 
    static String next() throws IOException {
 
        while ( ! tokenizer.hasMoreTokens() ) {
 
            tokenizer = new StringTokenizer(
 
                    reader.readLine() );
 
        }
        return tokenizer.nextToken();
 
    }
 
    static int nextInt() throws IOException {
 
        return Integer.parseInt( next() );
 
    }
 
    static double nextDouble() throws IOException {
 
        return Double.parseDouble( next() );
 
    }
 
    static long nextLong() {
 
        return Long.parseLong(nextToken());
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.BufferedReader;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.IOException;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.InputStream;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.io.InputStreamReader;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
    5 | import java.util.*;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:10:1: error: expected unqualified-id before 'public'
   10 | public class Main {
      | ^~~~~~
a.cc:42:8: error: expected unqualified-id before '[' token
   42 |     int[] array;
      |        ^
a.cc:78:2: error: expected ';' after class definition
   78 | }
      |  ^
      |  ;
a.cc: In constructor 'queue::queue(int)':
a.cc:47:9: error: 'array' was not declared in this scope
   47 |         array = new int[cap+1];
      |         ^~~~~
a.cc: In member function 'void queue::enqueue(int)':
a.cc:54:13: error: 'array' was not declared in this scope
   54 |             array[++front] = x;
      |             ^~~~~
a.cc:60:13: error: 'array' was not declared in this scope
   60 |             array[++rear] = x;
      |             ^~~~~
a.cc: In member function 'int queue::dequeue()':
a.cc:68:23: error: 'array' was not declared in this scope
   68 |             int out = array[front];
      |                       ^~~~~
a.cc:75:20: error: 'array' was not declared in this scope
   75 |             return array[front++];
      |                    ^~~~~
a.cc: At global scope:
a.cc:81:12: error: 'BufferedReader' does not name a type
   81 |     static BufferedReader reader;
      |            ^~~~~~~~~~~~~~
a.cc:82:12: error: 'StringTokenizer' does not name a type
   82 |     static StringTokenizer tokenizer;
      |            ^~~~~~~~~~~~~~~
a.cc:85:22: error: 'InputStream' has not been declared
   85 |     static void init(InputStream input) {
      |                      ^~~~~~~~~~~
a.cc:91:12: error: 'String' does not name a type
   91 |     static String nextToken() {
      |            ^~~~~~
a.cc:104:12: error: 'String' does not name a type
  104 |     static String next() throws IOException {
      |            ^~~~~~
a.cc:117:24: error: expected ';' at end of member declaration
  117 |     static int nextInt() throws IOException {
      |                        ^
      |                         ;
a.cc:117:26: error: 'throws' does not name a type
  117 |     static int nextInt() throws IOException {
      |                          ^~~~~~
a.cc:123:30: error: expected ';' at end of member declaration
  123 |     static double nextDouble() throws IOException {
      |                              ^
      |                               ;
a.cc:123:32: error: 'throws' does not name a type
  123 |     static double nextDouble() throws IOException {
      |                                ^~~~~~
a.cc:133:2: error: expected ';' after class definition
  133 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Reader::init(int)':
a.cc:86:9: error: 'reader' was not declared in this scope; did you mean 'Reader'?
   86 |         reader = new BufferedReader(new InputStreamReader(input) );
      |         ^~~~~~
      |         Reader
a.cc:86:22: error: expected type-specifier before 'BufferedReader'
   86 |         reader = new BufferedReader(new InputStreamReader(input) );
      |                      ^~~~~~~~~~~~~~
a.cc:87:9: error: 'tokenizer' was not declared in this scope
   87 |         tokenizer = new StringTokenizer("");
      |         ^~~~~~~~~
a.cc:87:25: error: expected type-specifier before 'StringTokenizer'
   87 |         tokenizer = new StringTokenizer("");
      |                         ^~~~~~~~~~~~~~~
a.cc: In static member function 'static long int Reader::nextLong()':
a.cc:131:16: error: 'Long' was not declared in this scope; did you mean 'long'?
  131 |         return Long.parseLong(nextToken());
      |                ^~~~
      |                long
a.cc:131:31: error: 'nextToken' was not declared in this scope
  131 |         return Long.parseLong(nextToken());
      |                               ^~~~~~~~~