criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <time.h>
#define int long long
using namespace std;
signed main(){
	int x[5];
	for (int i = 0; i < 4; i++) {
		cin >> x[i];
	}
	if (x[0] < x[2]) {
		cout << x[2] << " " << x[3] + 1 << " " << x[0] << " " << x[3] + 1 << endl;
		return 0;
	}
	else if (x[1] < x[3]) {
		cout << x[0] - 1 << " " << x[2] << " " << x[0] - 1 << " " << x[1] << endl;
		return 0;
	}
	else if(x[0]>x[2]){
		cout << x[2] << " " << x[3] - 1 << " " << x[0] << " " << x[1] - 1 << endl;
		return 0;
	}
	else {
		cout << x[0] + 1 << " " << x[3] << " " << x[0] + 1 << " " << x[1] << emdl;
	}
	system("PAUSE");
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:86: error: 'emdl' was not declared in this scope
   29 |                 cout << x[0] + 1 << " " << x[3] << " " << x[0] + 1 << " " << x[1] << emdl;
      |                                                                                      ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,d,e,f,g,h;
  cin>>a>>b>>c>>d;
  e=c-d+b;
  f=d+c-a;
  g=e-c+a;
  h=f-d+b;
  cout<<e<<f<<g<<hendl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: 'hendl' was not declared in this scope
   10 |   cout<<e<<f<<g<<hendl;
      |                  ^~~~~
Language: C++

#include<iostream>

using namespace std;
int main(){
  int ax,ay,bx,by,cx,cy,dx,dy;
  cin >> a1 >> a2 >> b1 >> b2;
  dy=ay-(ax-bx);
  dx=ax+(ay-by);
  cx=bx+(ay-by);
  cy=by-(ax-by);
  cout << cx << cy << dx << dy << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: 'a1' was not declared in this scope; did you mean 'ay'?
    6 |   cin >> a1 >> a2 >> b1 >> b2;
      |          ^~
      |          ay
a.cc:6:16: error: 'a2' was not declared in this scope; did you mean 'ay'?
    6 |   cin >> a1 >> a2 >> b1 >> b2;
      |                ^~
      |                ay
a.cc:6:22: error: 'b1' was not declared in this scope; did you mean 'by'?
    6 |   cin >> a1 >> a2 >> b1 >> b2;
      |                      ^~
      |                      by
a.cc:6:28: error: 'b2' was not declared in this scope; did you mean 'by'?
    6 |   cin >> a1 >> a2 >> b1 >> b2;
      |                            ^~
      |                            by
Language: C++

#include <iostream>
#include <cstdint>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
typedef vector<vector<ll>> vvll;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rrep(i, n) for (ll i = 1; i <= (n); ++i)
#define irep(it, stl) for (auto it = stl.begin(); it != stl.end(); it++)
#define drep(i, n) for (ll i = (n)-1; i >= 0; --i)
#define mes(a) cout << (a) << endl
#define dmes(a, b) cout << (a) << " " << (b) << endl
#define re0 return 0
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define rSort(a) sort(a.rbegin(), a.rend())
#define Rev(a) reverse(a.begin(), a.end())
#define MATHPI acos(-1)
#define itn int
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
struct io
{
    io()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
};
const int INF = INT_MAX;
const ll LLINF = 1LL << 60;
const ll MOD = 1000000007;
const double EPS = 1e-19;






signed main() {
    ll n, k;
    cin >> n >> k;
    ll r = 0;
    
    r = pow(n/k,3);
    
    if (k % 2 == 0) {
        r += pow(n/(k/2) - n/k, 3)
    }
    
    mes(r);

}
    
    
    
    
    


Compiler output:
a.cc: In function 'int main()':
a.cc:100:35: error: expected ';' before '}' token
  100 |         r += pow(n/(k/2) - n/k, 3)
      |                                   ^
      |                                   ;
  101 |     }
      |     ~
Language: C++

#include <iostream>
#include <vector>
#include <ios>
#include <iomanip>


int main() {
  using namespace std;
  int N, K;
  cin >> N >> K;

  long c1 = N / K;
  long c2 = K % 2 == 0 ? (N - K/2)/K + 1 : 0;
  c2 = N < K/2 == 0 ? c2;

  cout << c1*c1*c1 + c2*c2*c2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:25: error: expected ':' before ';' token
   14 |   c2 = N < K/2 == 0 ? c2;
      |                         ^
      |                         :
a.cc:14:25: error: expected primary-expression before ';' token
Language: C++

#include <iostream>
#include <vector>
#include <ios>
#include <iomanip>


int main() {
  using namespace std;
  int N, K;
  cin >> N >> K;

  long c1 = N / K;
  long c2 = K % 2 == 0 ? (N - K/2)/K + 1 : 0;
  c2 = N <= K/2 ? 0 : c2

  cout << c1*c1*c1 + c2*c2*c2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:25: error: expected ';' before 'cout'
   14 |   c2 = N <= K/2 ? 0 : c2
      |                         ^
      |                         ;
   15 | 
   16 |   cout << c1*c1*c1 + c2*c2*c2 << endl;
      |   ~~~~
Language: C++

include <bits/stdc++.h>
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(a)     (a).begin(),(a).end()
#define VI         vector<int>
#define MOD 1000000007

typedef long long int ll;

const ll INF=(ll)1e19;
//const int INF=(1<<30);

int main(){
  ll n, k;
  cin >> n >> k;
 
  ll ans = 0;
  if(k%2==0){
    ans += (n/k)*(n/k)*(n/k);
    ans += ((n-k/2)/k+1)*((n-k/2)/k+1)*((n-k/2)/k);
 
  }else{
    ans += (n/k)*(n/k)*(n/k);
  }
  cout << ans << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:17:3: error: 'cin' was not declared in this scope
   17 |   cin >> n >> k;
      |   ^~~
a.cc:27:3: error: 'cout' was not declared in this scope
   27 |   cout << ans << endl;
      |   ^~~~
a.cc:27:18: error: 'endl' was not declared in this scope
   27 |   cout << ans << endl;
      |                  ^~~~
Language: C++

int main(){
  ll n, k;
  cin >> n >> k;
 
  ll ans = 0;
  if(k%2==0){
    ans += (n/k)*(n/k)*(n/k);
    ans += ((n-k/2)/k+1)*((n-k/2)/k+1)*((n-k/2)/k);
 
  }else{
    ans += (n/k)*(n/k)*(n/k);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:3: error: 'll' was not declared in this scope
    2 |   ll n, k;
      |   ^~
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> n >> k;
      |   ^~~
a.cc:3:10: error: 'n' was not declared in this scope
    3 |   cin >> n >> k;
      |          ^
a.cc:3:15: error: 'k' was not declared in this scope
    3 |   cin >> n >> k;
      |               ^
a.cc:5:5: error: expected ';' before 'ans'
    5 |   ll ans = 0;
      |     ^~~~
      |     ;
a.cc:7:5: error: 'ans' was not declared in this scope
    7 |     ans += (n/k)*(n/k)*(n/k);
      |     ^~~
a.cc:11:5: error: 'ans' was not declared in this scope
   11 |     ans += (n/k)*(n/k)*(n/k);
      |     ^~~
a.cc:13:3: error: 'cout' was not declared in this scope
   13 |   cout << ans << endl;
      |   ^~~~
a.cc:13:11: error: 'ans' was not declared in this scope
   13 |   cout << ans << endl;
      |           ^~~
a.cc:13:18: error: 'endl' was not declared in this scope
   13 |   cout << ans << endl;
      |                  ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(i=a;i<=n;i++)
#define ll long long
int main(){
  ll i,j;
  ll N,K;
  ll countMod[200001];
  ll sum = 0;
  ll sumTmp;
    
  cin >> N >> K ;
  rep(i,0,K-1)
   countMod[i] = 0;
  
  rep(i,1,N){
    if(2*i%K == 0)
      countMod[i%K] += 1;
  }
  rep(i,0,K-1){
    sumTmp = sum;
    sum += pow(countMod[i],3);
  }
　cout << sum << endl;  
}

Compiler output:
a.cc:24:1: error: extended character 　 is not valid in an identifier
   24 | 　cout << sum << endl;
      | ^
a.cc: In function 'int main()':
a.cc:24:1: error: '\U00003000cout' was not declared in this scope
   24 | 　cout << sum << endl;
      | ^~~~~~
Language: C++

int main() {
    int N, K;
    cin >> N >> K;
    ll ans = pow(N/K, 3);
    if (K % 2 == 0) {
        ans += pow((2*N/K+1)/2, 3);
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> N >> K;
      |     ^~~
a.cc:4:5: error: 'll' was not declared in this scope
    4 |     ll ans = pow(N/K, 3);
      |     ^~
a.cc:6:9: error: 'ans' was not declared in this scope
    6 |         ans += pow((2*N/K+1)/2, 3);
      |         ^~~
a.cc:6:16: error: 'pow' was not declared in this scope
    6 |         ans += pow((2*N/K+1)/2, 3);
      |                ^~~
a.cc:8:5: error: 'cout' was not declared in this scope
    8 |     cout << ans << endl;
      |     ^~~~
a.cc:8:13: error: 'ans' was not declared in this scope
    8 |     cout << ans << endl;
      |             ^~~
a.cc:8:20: error: 'endl' was not declared in this scope
    8 |     cout << ans << endl;
      |                    ^~~~
Language: C++

    int N, K;
    cin >> N >> K;
    ll ans = pow(N/K, 3);
    if (K % 2 == 0) {
        ans += pow((2*N/K+1)/2, 3);
    }
    cout << ans << endl;

Compiler output:
a.cc:2:5: error: 'cin' does not name a type
    2 |     cin >> N >> K;
      |     ^~~
a.cc:3:5: error: 'll' does not name a type
    3 |     ll ans = pow(N/K, 3);
      |     ^~
a.cc:4:5: error: expected unqualified-id before 'if'
    4 |     if (K % 2 == 0) {
      |     ^~
a.cc:7:5: error: 'cout' does not name a type
    7 |     cout << ans << endl;
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    int N, K;
    cin >> N >> K;
    int a = N / K;
    if (K % 2 == 1) {
        ll ans = pow(a, 3);
        cout << ans << endl;
    }
    else{
        int b = a;
        if (N % K >= K / 2) b++;
        ll ans = pow(a, 3) + pow(b, 3);
        cout << ans << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'll' was not declared in this scope
    9 |         ll ans = pow(a, 3);
      |         ^~
a.cc:10:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |         cout << ans << endl;
      |                 ^~~
      |                 abs
a.cc:15:9: error: 'll' was not declared in this scope
   15 |         ll ans = pow(a, 3) + pow(b, 3);
      |         ^~
a.cc:16:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

#include<bits/stdc++.h>

#define rep(i, n) for(int i = 1; i <= (n); ++i)

using namespace std;

int main() {
  int n, k; cin >> n >> k;

  ll ans = pow(n/k, 3);
  if(!(k%2)) ans += pow((n+(k/2))/k, 3);
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'll' was not declared in this scope
   10 |   ll ans = pow(n/k, 3);
      |   ^~
a.cc:11:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |   if(!(k%2)) ans += pow((n+(k/2))/k, 3);
      |              ^~~
      |              abs
a.cc:12:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>
using namespace std;

//long long型(64bit整数)
typedef long long int;

int main(){
    int n, k;
    cin >> n >> k;
    int ans = 0;
    if(k % 2 == 0){
        int count1 = 0, count2 = 0;
        for(int i=1; i<=n; i++){
            if(i % k == 0) count1++;
            if(i % k == k/2) count2++;
        }
        ans = (count1 * count1 * count1 + count2 * count2 * count2);
    }else{
        int count3 = 0;
        for(int i=1; i<=n; i++){
            if(i % k == 0) count3++;
        }
        ans = (count3 * count3 * count3);
    }
    
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc:5:19: error: declaration does not declare anything [-fpermissive]
    5 | typedef long long int;
      |                   ^~~
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<limits.h>

int main(){
	int n, k;
	int multi, half_multi
	long ret;
	scanf("%d %d\n", &n, &k);
	multi = n / k;
	ret = multi * multi * multi;
	if(k%2 == 0) {
		half_multi = n / (k/2) - multi;
		ret += half_multi * half_multi * half_multi;
	}
	printf("%ld\n", ret);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'long'
    8 |         long ret;
      |         ^~~~
main.c:11:9: error: 'ret' undeclared (first use in this function)
   11 |         ret = multi * multi * multi;
      |         ^~~
main.c:11:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:17: error: 'half_multi' undeclared (first use in this function)
   13 |                 half_multi = n / (k/2) - multi;
      |                 ^~~~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <string>
#define ll long long
#define vl vector<ll>
#define vvl vector<vector<ll> >
#define vvvl vector<vector<vector<ll> > >
#define vd vector<double>
#define vvd vector<vector<double> >
#define vvvd vector<vector<vector<double> > >
#define mod 1000000007
using namespace std;

int main(){
	ll n, k; cin >> n >> k;
	ll ans = 0, e = 0,o = 0;
	for (ll i = k % 2 ? 2 : 1; (i*k)/2 <= n; i+= k % 2 ? 2 : 1){
		if (i % 2) o++;
		else e++;
	}cout << (ll)(pow(o, 3) + pow(e, 3)) << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:23: error: 'pow' was not declared in this scope
   22 |         }cout << (ll)(pow(o, 3) + pow(e, 3)) << endl;
      |                       ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
const int MAX = 3000005;
int fac[MAX], inv[MAX], finv[MAX];
int mod = 1e9+7;
void pre(){
  inv[1]=1;
  for (int i = 2; i <MAX ; i++)
  {
    inv[i]=inv[mod%i]*(mod-mod/i)%mod;
  }
  fac[0]=finv[0]=1;
  for (int i = 1; i < MAX; ++i)
  {
    fac[i]=fac[i-1]*i%mod;
    finv[i]=finv[i-1]*inv[i]%mod;
  }
}
int ncr(int n, int r){
  if(r<0||r>n)return 0;
  return fac[n]*finv[r]%mod*finv[n-r]%mod;
}

signed main(){
  pre();
  int n,k;
  cin >> n >> k;
  
  int c = 0,d = 0, ans = 0;
  
  if(k%2){
    for(int i = 1;i<=n;i++){
      if(i%k==0)c++;
    }
    ans = nCr(c,3);
  }
  else{
    for(int i = 1;i<=n;i++){
      if(i%(k/2)==0 || i%k==0)d++;
    }
    ans = nCr(d,3);
  }
  
  cout << ans << endl;
  return 0;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:36:11: error: 'nCr' was not declared in this scope; did you mean 'ncr'?
   36 |     ans = nCr(c,3);
      |           ^~~
      |           ncr
a.cc:42:11: error: 'nCr' was not declared in this scope; did you mean 'ncr'?
   42 |     ans = nCr(d,3);
      |           ^~~
      |           ncr
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
const int MAX = 3000005;
int fac[MAX], inv[MAX], finv[MAX];

void pre(){
  inv[1]=1;
  for (int i = 2; i <MAX ; i++)
  {
    inv[i]=inv[mod%i]*(mod-mod/i)%mod;
  }
  fac[0]=finv[0]=1;
  for (int i = 1; i < MAX; ++i)
  {
    fac[i]=fac[i-1]*i%mod;
    finv[i]=finv[i-1]*inv[i]%mod;
  }
}
int ncr(int n, int r){
  if(r<0||r>n)return 0;
  return fac[n]*finv[r]%mod*finv[n-r]%mod;
}

signed main(){
  pre();
  int n,k;
  cin >> n >> k;
  
  int c = 0,d = 0, ans = 0;
  
  if(k%2){
    for(int i = 1;i<=n;i++){
      if(i%k==0)c++;
    }
    ans = nCr(c,3);
  }
  else{
    for(int i = 1;i<=n;i++){
      if(i%(k/2)==0 || i%k==0)d++;
    }
    ans = nCr(d,3);
  }
  
  cout << ans << endl;
  return 0;
}
  

Compiler output:
a.cc: In function 'void pre()':
a.cc:11:16: error: 'mod' was not declared in this scope; did you mean 'modf'?
   11 |     inv[i]=inv[mod%i]*(mod-mod/i)%mod;
      |                ^~~
      |                modf
a.cc:16:23: error: 'mod' was not declared in this scope; did you mean 'modf'?
   16 |     fac[i]=fac[i-1]*i%mod;
      |                       ^~~
      |                       modf
a.cc: In function 'long long int ncr(long long int, long long int)':
a.cc:22:25: error: 'mod' was not declared in this scope; did you mean 'modf'?
   22 |   return fac[n]*finv[r]%mod*finv[n-r]%mod;
      |                         ^~~
      |                         modf
a.cc: In function 'int main()':
a.cc:36:11: error: 'nCr' was not declared in this scope; did you mean 'ncr'?
   36 |     ans = nCr(c,3);
      |           ^~~
      |           ncr
a.cc:42:11: error: 'nCr' was not declared in this scope; did you mean 'ncr'?
   42 |     ans = nCr(d,3);
      |           ^~~
      |           ncr
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()

using namespace std;

typedef long long ll;

static const int INTINF = (2147483647);
static const ll LLINF = (9223372036854775807);
static const int MAX = 100001;
static const ll MOD = 1000000007;

namespace Printer{
    void print(vector<int> v){
        rep(i, v.size()){
            if(i) cout << " ";
            cout<< v[i];
        }
        cout << endl;
    }

    void print(vector<vector<int> > vv){
        rep(i, vv.size()){
            rep(j, vv[i].size()){
                if(j) cout << " ";
                cout << vv[i][j];
            }
            cout << endl;
        }
    }
};

//--global--//



//----------//

int main(int argc, const char * argv[]) {
    //提出時、消す----//
    //--------------//

    // int a = 114191;
    // rep(i, MAX){
    //     if(pow(i, 3) == a){
    //         cout << i << endl;
    //         return 0;
    //     }
    //     if(pow(i, 3) <= a){
    //         cout << pow(i, 3) << endl;
    //     }
    // }
    // return 0;

    int N, K;
    cin>>N>>K;
  if(K%2==0){
    int X=N/K,Y=(N+K/2)/K;
    ans=X*X*X+Y*Y*Y;
  }
  else{
    int X=N/K;
    ans=X*X*X;
  }
  cout<<ans<<endl;
    
    
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:61:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   61 |     ans=X*X*X+Y*Y*Y;
      |     ^~~
      |     abs
a.cc:65:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   65 |     ans=X*X*X;
      |     ^~~
      |     abs
a.cc:67:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   67 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,k;
  cin >> n >> k;
  int i;
  int cnt[2] = {0,0};
  for(i=1;i<=n;i++){
    if(i%k==0)cnt[0]++;
    else if((i*2)%k==0)cnt[1]++;
  }
  long ans = (long)nt[0]*cnt[0]*cnt[0]+(long)cnt[1]*cnt[1]*cnt[1];
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: 'nt' was not declared in this scope; did you mean 'cnt'?
   12 |   long ans = (long)nt[0]*cnt[0]*cnt[0]+(long)cnt[1]*cnt[1]*cnt[1];
      |                    ^~
      |                    cnt
Language: C++

/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int mod = 1000000007;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);


ll Len(ll n) {
  ll s=0;
  while(n!=0) s++, n/=10;
  return s;
}


ll Sint(ll n) {
  ll m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(ll i=s-1;i>=0;i--) m+=n/((ll)pow(10,i))-(n/((ll)pow(10,i+1)))*10;
  return m;
}


ll Svec(vector<ll> v){
  ll n=0;
  for(ll i=0;i<v.size();i++) n+=v[i];
  return n;
}


ll GCD(ll a,ll b){
  ll r,tmp;
/*自然数 a > b を確認・入替*/
  if(a<b){
    tmp=a,a=b,b=tmp;
  }
/*ユークリッドの互除法*/
  r=a%b;
  while(r!=0){
    a=b,b=r,r=a%b;
  }
  return b;
}


ll LCM(ll a,ll b){
  ll c=a,d=b,r,tmp;
/*自然数 a > b を確認・入替*/
  if(a<b){
    tmp=a,a=b,b=tmp;
  }
/*ユークリッドの互除法*/
  r=a%b;
  while(r!=0){
    a=b,b=r,r=a%b;
  }
  return c/b*d;
}


ll Factorial(ll n){
  ll m=1;
  while(n>=1) m*=n,n--;
  return m;
}

vector<pair<char,ll>> runlength(string s,vector<pair<char,ll>> p){
  ll x=1;
  if(s.size()==1){
    p.push_back(pair<char,ll>(s[0],1));
    return p;
  }
  for(ll i=0;i<s.size()-1;i++){
    if(s[i]==s[i+1]){
      x++;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[i],x));
      }
    }else{
      p.push_back(pair<char,ll>(s[i],x));
      x=1;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[s.size()-1],x));
      }
    }
  }
  return p;
}



/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  IOS;
  ll n;
  cin>>n>>k;
  ll ans=(ll)pow(n/k,3);
  if(k%2==1){
    cout<<ans<<endl;
  }else{
    ll cnt=0;
    for(ll i=1;i<=n;i++){
      if(i%k==k/2) cnt++;
    }
    cout<<ans+(ll)pow(cnt,3)<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:98:11: error: 'k' was not declared in this scope
   98 |   cin>>n>>k;
      |           ^
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stdio.h>
#include <list>
#include <numeric>
#include <stack>
#include <queue>
#include <tuple>
#include <bitset>
#include <map>
#include <math.h>
//　ceil(a/b)   (a + (b - 1))/ b
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
typedef long long ll;
typedef pair<int,int> P;
const int inf=1000000007;
const int mod=1000000007;
int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};

int gcd(int a, int b){
  if (a%b==0){
    return(b);
  }
  else{
    return(gcd(b,a%b));
  }
}


// ll memo[2020][2020];
// int pascal_triangle(){
//   for(int i = 0; i < 2020; i++){
//     for(int j = 0; j < i+1; j++){
//       if(j == 0 || j == i) memo[i][j] = 1;
//       else{
// 	memo[i][j] = (memo[i-1][j-1]+memo[i-1][j]);
//       }
//     }
//   }
//   return 0;
// }


int factrial(int n){
  if(n == 0) return 1;
  return n*factrial(n-1);
}

// int comb(int n, int k){
//   return fact(n) / (fact(n-k)*fact(k));
// }




int main(){
  int N,K;
  cin >> N >> K;
  int a = 0;
  int num = 0
  int b = 0;
  int ans = 0;
  int n = N/K;
  ans += pow(n,3);
  if(K%2 == 0){
    rep(i,N){
      if((i+1) % K == K/2) num++
    }
  }
  ans += pow(num,3);
  cout << ans << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:67:3: error: expected ',' or ';' before 'int'
   67 |   int b = 0;
      |   ^~~
a.cc:73:33: error: expected ';' before '}' token
   73 |       if((i+1) % K == K/2) num++
      |                                 ^
      |                                 ;
   74 |     }
      |     ~
Language: C++

#include "iostream"
using namespace std;
int main(){
    long long n,k,a,b;
    cin >>n>>k;
    if (k%2) {
        a=n/k;
        cout <<a*a*a<<endl;
    } else{
        a=n/k;
        b=n/(k/2);
        cout <<a*a*a+pow(b-a,3)<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: 'pow' was not declared in this scope
   12 |         cout <<a*a*a+pow(b-a,3)<<endl;
      |                      ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll 
int main(){
    ll n,k;
    cin >> n >> k;
    if (k%2) {
        ll a;
        a = n/k;
        cout << pow(a,3) << '\n';
    }else{
        ll a,b;
        a = n/k;
        b = n/(k/2);
        cout << pow(a,3) + pow(b - a,3) << '\n';
    }
}


Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'll'
    3 | using ll
      |       ^~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <sstream>
#include <utility>
#include <iomanip>
#include <tuple>
#define ll long long int
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()
using namespace std;

ll dp[200005] = {};

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int n,k;
	cin >> n >> k;
	ll ans = 0;
	ans += n/k * n/k * n/k;
	
	if(k%2 == 0){
		int tmp = n - k/2;
		ans += pow(1+tmp/k)*(1+tmp/k)*(1+tmp/k);
	}
	cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:27: error: no matching function for call to 'pow(int)'
   28 |                 ans += pow(1+tmp/k)*(1+tmp/k)*(1+tmp/k);
      |                        ~~~^~~~~~~~~
In file included from a.cc:3:
/usr/include/c++/14/cmath:1074:5: note: candidate: 'template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::pow(_Tp, _Up)'
 1074 |     pow(_Tp __x, _Up __y)
      |     ^~~
/usr/include/c++/14/cmath:1074:5: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/bits/requires_hosted.h:31,
                 from /usr/include/c++/14/iostream:38,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note: candidate: 'double pow(double, double)'
  173 | __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
      | ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:380:3: note: candidate: 'constexpr long double std::pow(long double, long double)'
  380 |   pow(long double __x, long double __y)
      |   ^~~
/usr/include/c++/14/cmath:380:3: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:376:3: note: candidate: 'constexpr float std::pow(float, float)'
  376 |   pow(float __x, float __y)
      |   ^~~
/usr/include/c++/14/cmath:376:3: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
    long long n, k;
  	cin >> n >> k;
    if(k%2==0)
		cout<<pow(n/k, 3)+pow(n/(k/2)-n/k, 3)<<endl;;
    else
		cout<<pow(n/k, 3)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'else' without a previous 'if'
    9 |     else
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
    long long n, k,;
  	cin >> n >> k;
    if(k%2==0)
	cout<<pow(n/k, 3)+pow(n/(k/2)-n/k, 3)<<endl;;
    else
	cout<<pow(n/k, 3)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:20: error: expected unqualified-id before ';' token
    5 |     long long n, k,;
      |                    ^
a.cc:9:5: error: 'else' without a previous 'if'
    9 |     else
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef ll long long;

int main(){
  int n, k;
  cin >> n >> k;
  ll a = n/k, b = (n - k/2)/k + 1;
  if ( k % 2 == 0){
    cout << a * a * a  + b * b * b<< endl;
  } else {
    cout << a * a * a << endl;
  }

  return 0;
}

Compiler output:
a.cc:3:9: error: 'll' does not name a type
    3 | typedef ll long long;
      |         ^~
a.cc: In function 'int main()':
a.cc:8:3: error: 'll' was not declared in this scope
    8 |   ll a = n/k, b = (n - k/2)/k + 1;
      |   ^~
a.cc:10:13: error: 'a' was not declared in this scope
   10 |     cout << a * a * a  + b * b * b<< endl;
      |             ^
a.cc:10:26: error: 'b' was not declared in this scope
   10 |     cout << a * a * a  + b * b * b<< endl;
      |                          ^
a.cc:12:13: error: 'a' was not declared in this scope
   12 |     cout << a * a * a << endl;
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define  rep(i, n) for(int i = 0; i < n; i++) 
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  INF 1000000000
#define  pow(x) pow(10,(x)) 
typedef long long int LL;
const int MOD = 1000000007;
//sort(all(x))とするとソートできるよ



int main(){
    int N,K;cin >> N >> K;
    vector<LL> num(K,0);
    rep(i,N+1)num[(i+1)%K]++;   //num[x] は　Kで割ってx余る数が[1,N]にいくつあるか
    LL res = 0;
    rep(i,K){
        int b = (K-a) % K;  //a mod K と K-a mod K　の和は K mod K になり、その値は0のはず。
        int c = (K-a) % K;  //a+b,a+cの合同式が一致するので、a+b mod K ,a+c mod K が一致。なので、b,cともに K-a mod K となる。
        if( (b+c) % K != 0)continue;    //aの固定により、b,cの必要条件 K-a mod K が確定したので、十分条件 b+c mod K の確認をしている。
        res += num[a] * num[b] * num[c];
    }
    cout << res << endl;   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:20: error: 'a' was not declared in this scope
   20 |         int b = (K-a) % K;  //a mod K と K-a mod K　の和は K mod K になり、その値は0のはず。
      |                    ^
Language: C++

N, K = map(int, input().split())

if K%2 != 0:
  a = N//K
  print(a**3)
else:
  a = N//K
  b = N//(K//2) - a
  print(a**3 + b**3)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N, K = map(int, input().split())
      | ^
Language: C++

#include <bits/stdc++.h>
#define r(i,n) for(int i = 0; i<n; i++)
using namespace std;
 
int main{
  int n, k, a;
  cin >> n >> k;
  a=n/k;
  cout << a*a*a<< endl;
}


Compiler output:
a.cc:5:5: error: cannot declare '::main' to be a global variable
    5 | int main{
      |     ^~~~
a.cc:6:3: error: expected primary-expression before 'int'
    6 |   int n, k, a;
      |   ^~~
a.cc:6:3: error: expected '}' before 'int'
a.cc:5:9: note: to match this '{'
    5 | int main{
      |         ^
a.cc:7:3: error: 'cin' does not name a type
    7 |   cin >> n >> k;
      |   ^~~
a.cc:8:3: error: 'a' does not name a type
    8 |   a=n/k;
      |   ^
a.cc:9:3: error: 'cout' does not name a type
    9 |   cout << a*a*a<< endl;
      |   ^~~~
a.cc:10:1: error: expected declaration before '}' token
   10 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define r(i,n) for(int i = 0; i<n; i++)
using namespace std;
 
int main{
  int n, k, a;
  cin >> n >> k;
  n/k=a;
  cout << a*a*a<< endl;
}


Compiler output:
a.cc:5:5: error: cannot declare '::main' to be a global variable
    5 | int main{
      |     ^~~~
a.cc:6:3: error: expected primary-expression before 'int'
    6 |   int n, k, a;
      |   ^~~
a.cc:6:3: error: expected '}' before 'int'
a.cc:5:9: note: to match this '{'
    5 | int main{
      |         ^
a.cc:7:3: error: 'cin' does not name a type
    7 |   cin >> n >> k;
      |   ^~~
a.cc:8:3: error: 'n' does not name a type
    8 |   n/k=a;
      |   ^
a.cc:9:3: error: 'cout' does not name a type
    9 |   cout << a*a*a<< endl;
      |   ^~~~
a.cc:10:1: error: expected declaration before '}' token
   10 | }
      | ^
Language: C++

#include <iostream>
#include <map>
#include <algorithm>
#include <string>
#include <vector> 


#define CHMAX(a,b) a = std::max(a,b)
#define CHMIN(a,b) a = std::min(a,b)
#define CHABS(a) a = std::abs(a) 
#define COUT(a) std::cout << a << std::endl
#define CERR(a) std::cerr << a << std::endl

using namespace std;
using lli = long long int;

lli mod197 = 1000000007LL;

// ax + by = gcd(a,b) 最大公約数
template< typename T >
T extgcd(T a, T b, T& x, T& y) {
	T d = a;
	if (b != 0) {
		d = extgcd(b, a % b, y, x);
		y -= (a / b) * x;
	}
	else {
		x = 1;
		y = 0;
	}
	return d;
}

int main(void) {

	lli N, K;
	cin >> N >> K;

	if (K % 2 == 0) {
		COUT(pow((lli)(N / K), 3) + pow((lli)((N - K / 2) / K + 1), 3));
	}
	else {
		COUT(pow((lli)(N / K),3));
	}



	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:22: error: 'pow' was not declared in this scope
   40 |                 COUT(pow((lli)(N / K), 3) + pow((lli)((N - K / 2) / K + 1), 3));
      |                      ^~~
a.cc:11:30: note: in definition of macro 'COUT'
   11 | #define COUT(a) std::cout << a << std::endl
      |                              ^
a.cc:43:22: error: 'pow' was not declared in this scope
   43 |                 COUT(pow((lli)(N / K),3));
      |                      ^~~
a.cc:11:30: note: in definition of macro 'COUT'
   11 | #define COUT(a) std::cout << a << std::endl
      |                              ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;

int main()
{
	int N,K;
	cin>>N>>K;
	unsigned long ans=0;
	if(K%2==0){
		double num;
		num=(double)N/(double)K;
		ans+=pow(N/K,3);
		ans+=pow(round(num),3);
		cout<<ans;
	}else{
		ans+=pow(N/K,3)
		cout<<ans;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:32: error: expected ';' before 'cout'
   19 |                 ans+=pow(N/K,3)
      |                                ^
      |                                ;
   20 |                 cout<<ans;
      |                 ~~~~
Language: C++

#include "bits/stdc++.h"
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define mFOR(i, a, b) for (int i = a; i > b; i--)
#define MP make_pair
#define PB push_back
#define ALL(v) v.begin(), v.end()
#define N 100007
#define INF 1000000007
using namespace std;

typedef long long ll;

ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll fceil(ll a, ll b) { return (a % b == 0 ? a / b : a / b + 1); }
int main()
{
   ll n, k;
   cin >> n >> k;
   ll n1 = n / k, n2 = (n - k / 2) / k + 1;
   if (k % 2 != 0)
   {
      ll ans = pow(n1, 3);
   }
   else
   {
      ll ans = pow(n1, 3) + pow(n2, 3);
   }

   cout << ans << endl;

   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
   29 |    cout << ans << endl;
      |            ^~~
      |            abs
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <tuple>
#include <stack>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define print(s) cout << s << endl
using namespace std;
const int INF = 1e9;
typedef long long lint;
const lint LINF = 1e18;
const lint MOD = 1e9 + 7;
// const lint MOD = 998244353;
int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}
char upper(char c){
	return c-0x20;
}
char lower(char c){
	return c+0x20;
}

int gcd(int x, int y) {
  if (y == 0) return x;
  return gcd(y, x%y);
}
 
int main(){
	int n,k; cin>>n>>k;
	int ans = 0;
	ans += pow(n/k,3);
	if (k%2==0){
		ans += pow((n-k/2)k,3);
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:35: error: expected ')' before 'k'
   43 |                 ans += pow((n-k/2)k,3);
      |                           ~       ^
      |                                   )
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n, k;
    cin >> n >> k;
  	int z = k/2;
	long long ans = z*z*z;
 	int cnt = 0;
  	if(n&1)
    {
      cout << ans << "\n"
      return 0;
    }
  else
  {
  	for(int i = 1; i <= n; ++i)
    {
    	if((i%k) == k/2)
          cnt++;
    }
    cout << ans + cnt*cnt*cnt << "\n";
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: expected ';' before 'return'
   12 |       cout << ans << "\n"
      |                          ^
      |                          ;
   13 |       return 0;
      |       ~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
ll ans=(n/k)*(n/k)*(n/k);
  int cnt=0;
  if(k&1){cout<<ans;return 0;}
for(int i=1;i<=n;i++)if((i%k)==k/2)cnt++;
  ans+=1ll*cnt*cnt*cnt;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'll' was not declared in this scope
    7 | ll ans=(n/k)*(n/k)*(n/k);
      | ^~
a.cc:9:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |   if(k&1){cout<<ans;return 0;}
      |                 ^~~
      |                 abs
a.cc:11:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |   ans+=1ll*cnt*cnt*cnt;
      |   ^~~
      |   abs
Language: C++

#include<iostream>
using namespace std ;

int main()
{
  int N,K ;
  cin>>N>>K ;
  
  int a,b,c ;
  int count= 0;
  for(a=1;a<=N;i++){
    for(b=1;b<=N;b++){
      for(c=1;c<=N;c++){
        if((a+b)%K!=0) break ;
        else if((b+c)%K!=0) break ;
        else if((a+c)%K!=0) break ;
        else count++ ;
      }
    }
  }
  
  cout<<count<<endl ;

  
  return 0 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: 'i' was not declared in this scope
   11 |   for(a=1;a<=N;i++){
      |                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,k;
  cin>>n>>k;
  if(k%2==1){cout<<(n/k)**3;}
  else{cout<<(n/k)**3+((n-k/2)/k+1)**3;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:26: error: invalid type argument of unary '*' (have 'int')
    6 |   if(k%2==1){cout<<(n/k)**3;}
      |                          ^~
a.cc:7:20: error: invalid type argument of unary '*' (have 'int')
    7 |   else{cout<<(n/k)**3+((n-k/2)/k+1)**3;}
      |                    ^~
a.cc:7:37: error: invalid type argument of unary '*' (have 'int')
    7 |   else{cout<<(n/k)**3+((n-k/2)/k+1)**3;}
      |                                     ^~
Language: C

#include<stdio.h>
int cube(int a){return a*a*a;}
int main(){int n,k;scanf("%d%d",&n,&k);printf("%d",cube(n/k)+(k%2?0:cube(2*n/k-n/k));}

Compiler output:
main.c: In function 'main':
main.c:3:85: error: expected ')' before ';' token
    3 | int main(){int n,k;scanf("%d%d",&n,&k);printf("%d",cube(n/k)+(k%2?0:cube(2*n/k-n/k));}
      |                                              ~                                      ^
      |                                                                                     )
main.c:3:86: error: expected ';' before '}' token
    3 | int main(){int n,k;scanf("%d%d",&n,&k);printf("%d",cube(n/k)+(k%2?0:cube(2*n/k-n/k));}
      |                                                                                      ^
      |                                                                                      ;
Language: C

#include<stdio>
int cube(int a){return a*a*a;}
int main(){int n,k;scanf("%d%d",&n,&k);printf("%d",cube(n/k)+(k%2?0:cube(2*n/k-n/k));}

Compiler output:
main.c:1:9: fatal error: stdio: No such file or directory
    1 | #include<stdio>
      |         ^~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
int cube(int a){
  return a * a * a;
}
int main(){
  int n, k;
  scanf("%d%d", &n, &k);
  printf("%d", cube(n / k) + ((k % 2) ? 0 : cube(1 + (n - k) / k)));
  return 0
}

Compiler output:
main.c: In function 'main':
main.c:9:11: error: expected ';' before '}' token
    9 |   return 0
      |           ^
      |           ;
   10 | }
      | ~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
using ll = long long;

int main() {
    int N, K;
    cin >> N >> K;

    int ans = pow(N / K, 3);
    if (K % 2 == 0) ans += pow((N-K/2)/K+1, 3);

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: 'pow' was not declared in this scope
   12 |     int ans = pow(N / K, 3);
      |               ^~~
Language: C++

#include <iostream>

using namespace std;
int main()
{
int N,K,a;
cin>>N>>K;
if(K%2==1)){cout<<(N/K)*(N/K)*(N/K);}
else if((K%2==0)&&(N>=K/2))
{
a=(N+K/2)/K;
cout<<((N/K)*(N/K)*(N/K))+(a*a*a);
}else
{
    cout<<0;
}


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected primary-expression before ')' token
    8 | if(K%2==1)){cout<<(N/K)*(N/K)*(N/K);}
      |           ^
Language: C++


#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#include <algorithm>
using namespace std;

#define lint long long
#define MAX 100000
int main() {
	
	long long N,K; cin >> N >> K;
	if (K % 2 != 0) {
		long long n = 0;
		for (long long i = 1; i < N + 1; i++) {
			long long (i %K == 0) {
				n++;
			}
		}

		cout << n*n*n << endl;
		return 0;
	}
	else {
		long long n1 = 0, n2 = 0;
		for (long long i = 1; i <= N; i++)
		{
			if (i %K == 0) {
				n1++; continue;
			}
			else if (i % (K / 2) == 0) {
				n2++; continue;
			}
		}

		cout << n1*n1*n1 + n2*n2*n2 << endl;
		return 0;
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:25: error: expected primary-expression before 'long'
   18 |                         long long (i %K == 0) {
      |                         ^~~~
Language: C++



#include "pch.h"
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#include <algorithm>
using namespace std;

#define lint long long
#define MAX 100000
int main() {
	
	long long N,K; cin >> N >> K;
	if (K % 2 != 0) {
		long long n = 0;
		for (long long i = 1; i < N + 1; i++) {
			long long (i %K == 0) {
				n++;
			}
		}

		cout << n*n*n << endl;
		return 0;
	}
	else {
		long long n1 = 0, n2 = 0;
		for (long long i = 1; i <= N; i++)
		{
			if (i %K == 0) {
				n1++; continue;
			}
			else if (i % (K / 2) == 0) {
				n2++; continue;
			}
		}

		cout << n1*n1*n1 + n2*n2*n2 << endl;
		return 0;
	}

}

Compiler output:
a.cc:3:10: fatal error: pch.h: No such file or directory
    3 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
int exp(int x,int y){
  int ans =1;
  for(int i = 0;i<y;i++){
  ans *= x;
  }
  return ans;
}

int main(){
  int N,K;
  cin>>N>>K;
  if(K%2==1){
   int cnt=0;
   for(int i=1;i<=N;i++){
   if(i%K==0){
     cnt++;
   }
   }
 cout<<exp(cnt,3);
  }
  else{
    int cntA,cntB =0;
    for(int j=1;j<=N;j++){
      if(i%K==0){
        cntA++;
      }
      else if(i*2%K==0){
        cntB++;
      }
    }
    cout<<exp(cntA,3)+exp(cntB,3);
  }
        
    
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:26:10: error: 'i' was not declared in this scope
   26 |       if(i%K==0){
      |          ^
Language: Java

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();

        // a % K = b % K = c % K == 0 or A % K = b % K = c % K = (K / 2) のみ
        long cand1 = N / K;
        long cand2 = 0;
        if (K % 2 == 0) {
            cand2 = N / (K / 2) - cand1;    //cond1と数字がかぶる
        }

        out.println(cand1 * cand1 * cand1 + cand2 * cand2 * cand2);
    }
}

Compiler output:
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
Main.java:14: error: cannot find symbol
        out.println(cand1 * cand1 * cand1 + cand2 * cand2 * cand2);
        ^
  symbol:   variable out
  location: class Main
3 errors
Language: C++

N,K =[int(i) for i in input().split()]
if K % 2 == 0:
    K_unit1 = int(N/K)
    K_half = K/2
    N_khalf = N-K_half
    K_unit2 = 1 + int(N_khalf/K)
    K1 = K_unit1 ** 3
    K2 = K_unit2 ** 3
    out = K1 + K2
else:
    K_unit1 = int(N/K)
    out = K_unit1 ** 3
 
print("{0}".format(out))

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N,K =[int(i) for i in input().split()]
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define UM unordered_map
#define ALL(a) (a).begin(), (a).end()
typedef vector<ll> vi;
typedef vector<vector<ll>> vvi;
typedef pair<ll, ll> pii;
const long long INF = 1LL << 58;
struct Edge
{
    ll s, t, d;
};
typedef vector<vector<Edge>> Graph;
typedef vector<pii> vpii;
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

signed main()
{
    int N, K;
    cin >> N >> K;
    if (K == 1 or N == 1)
    {
        cout << 1 << endl;
        return 0;
    }
    int a = 0;
    int b = 0;
    if (K % 2 == 0)
    {
        FOR(i, 1, N + 1)
        if (i % K == K / 2)
            b++;
        else if (i % K == 0)
            a++;
        cout << b * b * b + a * a * a << endl;
    }
    else
    {
        FOR(i, 1, N + 1)
        if (i % K == 0)
            a++;
        cout << a * a * a << endl;
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:66:6: error: expected '}' at end of input
   66 |     }
      |      ^
a.cc:41:1: note: to match this '{'
   41 | {
      | ^
Language: C++

#include <iostream>
#include <numeric>
#include <string>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <utility>

#define repd(i,a,b); for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define ll long long int
 
 
using namespace std;
int main() {
  int n,k; cin >> n >> k;
  if(k%2 == 0){
    cout << ((n-n%k)/k)*((n-n%k)/k)*((n-n%k)/k)+(((n+k/2)-(n+k/2)%k)/k)*(((n+k/2)-(n+k/2)%k)/k)*(((n+k/2)-(n+k/2)%k)/k);
  } else {
    cout << ((n-n%k)/k)*((n-n%k)/k)*((n-n%k)/k)
  }
 
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:48: error: expected ';' before '}' token
   21 |     cout << ((n-n%k)/k)*((n-n%k)/k)*((n-n%k)/k)
      |                                                ^
      |                                                ;
   22 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>

#define REP(i, n) for(int i = 0;i < n;i++)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define ll long long

using namespace std;

typedef pair<int, int> P;


int main(){
	ll n, k;
	cin >> n >> k;
	if (k%2==0) {
      	ll temp = n/(k/2)- n/k, 3);
		cout <<temp*temp*temp + (n/k)*(n/k)*(n/k) << endl;
		
	} else {
		cout << (n/k)*(n/k)*(n/k) << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:33: error: expected unqualified-id before numeric constant
   16 |         ll temp = n/(k/2)- n/k, 3);
      |                                 ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>

using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};

int main(){
    int N,K; cin >> N >> K;
    vector<int> num(k,0);
    //Kで割ってx余る数が何個あるか
    //->これを数えることでNすべてを探索しなくても良くなる
    for(int i=1;i<=N;i++) num[i%K]++;
    ll ans=0;
    for(int i=0;i<K;i++){
        //a%Kがきまると残りが決まる
        //->a+b，a+cがKの倍数になる必要があるから
        ll b = (K-i)%K;
        ll c = (K-i)%K;
        if((b+c)%K!=0) continue; //b+cがKの倍数でなければその組み合わせは加算しない
        ans += num[i]*num[b]*num[c];
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: 'k' was not declared in this scope
   18 |     vector<int> num(k,0);
      |                     ^
Language: C++

#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define pb push_back
#define sz(i) (int)(i.size())
#define F first
#define S second
#define L long double
#define P pair<int, int>
const int inf = 0x3f3f3f3f3f3f3f3LL;
const int mod = (int)1e9 + 7;
using namespace std;
#if ONLINE_JUDGE
#define tr(...)
#define endl '\n'
#else
#include "../../tr.h"
#endif
template<class T> void smin(T& a, T val) {if (a > val) a = val;}template<class T> void smax(T& a, T val) {if (a < val) a = val;}
const int N = 5*(int)1e5 + 10;

int n, f[2], k;

int get(int x){
   return x*x*x;
}

int32_t main(){_

   cin>>n>>k;

   for (int i = 1; i <= n; ++i)
   {
      if(i%k == 0){
         f[0]++;
      }
      else if(i%k == k/2){
         f[1]++;
      }
   }

   tr(f[0], f[1]);
   int ans = get(f[0]);
   if(k%2 == 0){
      ans += get(f[1]);
   }
   cout<<ans;

   #warning make sure N size is correct!
   return 0;
}

Compiler output:
a.cc:17:10: fatal error: ../../tr.h: No such file or directory
   17 | #include "../../tr.h"
      |          ^~~~~~~~~~~~
compilation terminated.