criyle/codenet-compile-errors huggingface dataset:
Language: Java

 public static void Main (String[] args) {    	    	
	    int N, M, back = 0;
	    Scanner sc = new Scanner(System.in);
	    N = sc.nextInt(); M = sc.nextInt();
	    
		int grid[][] = new int [N][M];
	
		for(int i=0; i<grid.length; i++)
			for(int j=0; j<grid[i].length; j++) {
				for(int k=-1; k<=1; k++)
					for (int l=-1; l<=1; l++) {
						if (i+k >= N || i+k < 0 || j+l >= M || j+l < 0)						
							continue;
						if (grid[i+k][j+l] == 0)
							grid[i+k][j+l]= 1;
						else 
							grid[i+k][j+l]= 0;
					}

			}

		for(int i=0; i<grid.length; i++)
			for(int j=0; j<grid[i].length; j++)
				if (grid[i][j]==1)
					back++;
		
		System.out.println(back);			
		sc.close();				
}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
 public static void Main (String[] args) {    	    	
               ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: C++

#include <bits/stdc++.h>
#include <iomanip>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
 
const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;

ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}
ll lcm(ll x,ll y){
  ll g=gcd(x,y);
  return x/g*y;
}

int main() {
  int N, M;  
  cin >> N >> M;
  if(N!=1 && M!=1){
    ll ans = (N-2)*(M-2)
    cout << ans  <<endl;
  }
  if(N==1 && M!=1){
    cout<< M-2 << endl;
  }
  if(N!=1 && M==1){
    cout << N-2 << endl;
  }
  if(N==1 && M==1){
    cout << 1 << endl;
  }
  return 0;
}
  



Compiler output:
a.cc: In function 'int main()':
a.cc:24:5: error: expected ',' or ';' before 'cout'
   24 |     cout << ans  <<endl;
      |     ^~~~
Language: C++

#include <cstdio>

int main()
{
  long long n, m;
  scanf("%lld %lld", &n, &m);
  
  if (n >= 2 && m >= 2)
  {
    printf("%lld\n", (n - 2) * (m - 2));
  }
  else if (n == 1 && m == 1)
  {
    puts("1");
  }
  else
  {
    printf("%lld\n", n == 1 ? m - 2 : n - 2);
  }
  return 0;
}
  }

Compiler output:
a.cc:22:3: error: expected declaration before '}' token
   22 |   }
      |   ^
Language: C++

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

int main(){
    long long N,M;
    cin >> N >> M;
    if(N>M) swap(N,M);
    long long ans;
    if(N==1 && M==1){
        ans = 1;
    } else if((N == 1){
        ans = M -2;
    } else{
        ans = (N-2) * (M-2);
    }
    cout << ans << endl;
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: expected ';' before '{' token
   11 |     } else if((N == 1){
      |                       ^
      |                       ;
a.cc:13:7: error: expected primary-expression before 'else'
   13 |     } else{
      |       ^~~~
a.cc:13:6: error: expected ')' before 'else'
   13 |     } else{
      |      ^~~~~
      |      )
a.cc:11:14: note: to match this '('
   11 |     } else if((N == 1){
      |              ^
Language: C++

# include <bits/stdc++.h>
# define INF 1e9
using namespace std;

int main(){

  int N, M;
  cin >> N >> M;
  int ans;
  if(M == 1 && N == 1){
    ans = 1;
  } else if(M == 1){
    ans = N-2;
  } else if(N == 1){
    ans = M-2;
  } else {
    ans = (N-2)*(M-2);
  }
  cout << ans << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:19:23: error: expected '}' at end of input
   19 |   cout << ans << endl;
      |                       ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

int main() {
    ll n,m;
    cin>>n>>m;
    if (n>m)
        swap(n,m);
    ll ans;
    if (n==1) {
        if (m==1)
            ans=1;
        else
            ans=m-2;
    else
        ans=(n-2)*(m-2);
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: expected '}' before 'else'
   16 |     else
      |     ^~~~
a.cc:11:15: note: to match this '{'
   11 |     if (n==1) {
      |               ^
Language: Java

import java.util.*;
public class Main{   
    public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int m = sc.nextInt();
      int x = Math.min(x,y);
      int y = Math.max(x,y);
      if(x==1&&y==1)System.out.println(1);
      else if(x==1)System.out.println(y-2);
      else System.out.println((x-1)*(y-1));
    }
    public static int lcm(int x, int y){
      return x*y/gcd(x,y);
    }
    public static int gcd(int x, int y){
      if(x < y)return gcd(y,x);
      if(y==0)return x;
      return gcd(y,x%y);
    }
}

Compiler output:
Main.java:7: error: cannot find symbol
      int x = Math.min(x,y);
                         ^
  symbol:   variable y
  location: class Main
1 error
Language: C++

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

if N > M:
	N,M = M,N

if N == 1:
	if M == 1:
		print(1)
	else:
		print(M-2)
else:
	print((M-2)*(N-2))


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

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define REP(i,m,n) for(int i=m;i<(int)(n);++i)

int main(){
    int n,m,ans=0;
    cin >> n >> m;
    if(n>=2&&m>=2) ans=(n-2)*(m-2);
    else if(n==1) ans=m-2;
    else if(m==1) ans=n-2;
    else if(n=1&&m=1) ans=1;
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: lvalue required as left operand of assignment
   12 |     else if(n=1&&m=1) ans=1;
      |               ~^~~
Language: C++

#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B,L,R;
string S,T;
const ll MOD = (1e+9) + 7;
const ll INF = 1LL << 60;
typedef pair<ll,ll> P;

typedef vector<P> vp;
typedef vector<vp> matP;

int main(){
    cin>>A>>B;
    if(A == 1 && B == 1) {
        cout<<1<<endl;
    }else if(min(A,B) == 1){
            cout<<max(0LL, max(A,B) - 2)<<endl;
        }
    }else{
        cout<<(A-2)*(B-2)<<endl;
    }
}

Compiler output:
a.cc:29:6: error: expected unqualified-id before 'else'
   29 |     }else{
      |      ^~~~
a.cc:32:1: error: expected declaration before '}' token
   32 | }
      | ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include<limits.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(),v.end()
#define RALL(v) v.rbegin(),v.rend()
#define check(v) rep(i,v.size()) cout << v[i] << " ";\
cout << endl
#define INF 1e8
typedef long long ll;
using namespace std;
//オーバーフローに気をつけろよおおおおおお
//確認忘れるなよおおおおおお

int main() {
    int a, b; cin >> a >> b;
    if(a==1 && b==1) cout << 1 << endl;
    if(a==2 && b==2) cout << 0 << endl;
    else {
        ll ans = (ll)max(a-2,1)*max(b-2,1);
        cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:22:12: note: to match this '{'
   22 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m;
  if(n==1&&m==1) cout << 1 << endl;
  else if(n==1||m==1){
    cout << (n==1?m-2:n-2) << endl;
  }
  else cout << (n-2)*(m-2) << endl;
  return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m;
  if(n==1&&m==1) cout << 1 << endl;
  else if(n==1){
    cout << m-2 << endl;
  }
  else cout << (n-2)*(m-2) << endl;
  return 0;
}


Compiler output:
a.cc:14:5: error: redefinition of 'int main()'
   14 | int main(){
      |     ^~~~
a.cc:3:5: note: 'int main()' previously defined here
    3 | int main(){
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)

int main(int argc, char const *argv[])
{
	int n, m; cin >> n >> m;
	if (n > m) swap(n, m);
	if (n == 1 and m == 1) {
		cout << 1 << endl;
	} else if (n == 1 or) {
		cout << m - 2 << endl;
	} else {
		cout << (n - 2) * (m - 2) << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:12:29: error: expected primary-expression before ')' token
   12 |         } else if (n == 1 or) {
      |                             ^
Language: C++

//要するに周りの数
#include <iostream>
using namespace std;
int main(){
  long long n,m;
  if(n==1||m==1){
    if(n==1&&m==1){
      cout << 1 << endl;
      return 0;
    }
    cout << (long long)n+m-1-2 << endl;
    return 0;
  }else{
	cout << (long long)cout << (n-1)*(m-1) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: invalid cast from type 'std::ostream' {aka 'std::basic_ostream<char>'} to type 'long long int'
   14 |         cout << (long long)cout << (n-1)*(m-1) << endl;
      |                 ^~~~~~~~~~~~~~~
Language: C++

//要するに周りの数
#include <iostream>
using namespace std;
int main(){
  long long n,m;
  if(n==1||m==1){
    if(n==1&&m==1){
      cout << 1 << endl;
      return 0;
    }
    cout << n+m-1-2 << endl;
    return 0;
  }else{
	(long long)cout << (n-1)*(m-1) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: invalid cast from type 'std::ostream' {aka 'std::basic_ostream<char>'} to type 'long long int'
   14 |         (long long)cout << (n-1)*(m-1) << endl;
      |         ^~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long n,m;
int main()
{
	cin>>n>>m;
	else if(n==1&&m==1)cout<<0;
	else if(n==1)cout<<m-2<<endl;
	else if(m==1)cout<<n-2<<endl;
	else cout<<n*m-(n+n+m+m-4)<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'else' without a previous 'if'
    7 |         else if(n==1&&m==1)cout<<0;
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  long long n,m;
  cin >> n >> m;
  if(n==1||m==1){
    if(n==1&&m==1){
      cout << 1 << endl;
    }
    else{
      cout << max(n,m)-2 <<endl;
    }
  }
  else{
    cout << (n-2)*(m-2) << endl;
  }
}

}

Compiler output:
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,m;
  cin >> n >> m;
  if(n==2||m==2){
    cout << 0 << endl;
  }
  else if(n==1||m==1){
    if(n==1&&m==1){
      cout << 0 << endl;
    }
    else{
      cout << max(n,m)-2 <<endl;
    }
  }
  else{
    long long ans=(n-2)*(m-2)
    cout << ans << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: expected ',' or ';' before 'cout'
   19 |     cout << ans << endl;
      |     ^~~~
Language: C++

nclude<bits/stdc++.h>
using namespace std;
int main() {
int N,M;
  cin>>N>>M;
  if(N>=2&&M>=2){
  cout<<(N-2)*(M-2)<<endl;
  }
  else if(N==1&&M==1){
  else if(N==2||M==2){     
    cout<<N*M-2<<endl;
  }
  else{
    cout<<0<<endl;
}
}

Compiler output:
a.cc:1:1: error: 'nclude' does not name a type
    1 | nclude<bits/stdc++.h>
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>N>>M;
      |   ^~~
a.cc:7:3: error: 'cout' was not declared in this scope
    7 |   cout<<(N-2)*(M-2)<<endl;
      |   ^~~~
a.cc:7:22: error: 'endl' was not declared in this scope
    7 |   cout<<(N-2)*(M-2)<<endl;
      |                      ^~~~
a.cc:10:3: error: expected '}' before 'else'
   10 |   else if(N==2||M==2){
      |   ^~~~
a.cc:9:22: note: to match this '{'
    9 |   else if(N==1&&M==1){
      |                      ^
a.cc:11:5: error: 'cout' was not declared in this scope
   11 |     cout<<N*M-2<<endl;
      |     ^~~~
a.cc:11:18: error: 'endl' was not declared in this scope
   11 |     cout<<N*M-2<<endl;
      |                  ^~~~
a.cc:14:5: error: 'cout' was not declared in this scope
   14 |     cout<<0<<endl;
      |     ^~~~
a.cc:14:14: error: 'endl' was not declared in this scope
   14 |     cout<<0<<endl;
      |              ^~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int main() {
    long long N, M;
    cin >> N >> M;
    //はしだけ調べればよい
    if(N == 1 and M == 1) {
        cout << 1 << endl;
        return 0;
    }
    if(N == 1 or M == 1) {
        cout << M - 2 << endl;
    } else {
        cout << N * M - 2 * (M + ) + 4 << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:34: error: expected primary-expression before ')' token
   43 |         cout << N * M - 2 * (M + ) + 4 << endl;
      |                                  ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int dx[8] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy[8] = {1, -1, 0, -1, 1, 0, -1, 1};
int main() {
    long long N, M;
    cin >> N >> M;
    //はしだけ調べればよい
    if(N == 1 and M == 1) {
        cout << 1 << endl;
        return 0;
    }
    if(n == 1 or m == 1) {
        cout << m - 2 << endl;
    } else {
        cout << n * m - 2 * (m + n) + 4 << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:8: error: 'n' was not declared in this scope
   42 |     if(n == 1 or m == 1) {
      |        ^
a.cc:42:18: error: 'm' was not declared in this scope
   42 |     if(n == 1 or m == 1) {
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define debug(x) cerr << "\n" \
                      << #x << ": " << x << "\n"
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define all(x) (x).begin(), (x).end()
#define INF 1e9
#define pii pair<int, int>
#define pt(xx) cout << "\n" \
                    << xx << "\n"
#define debugv(x, n)               \
    cout << "\n"                   \
         << #x << ": ";            \
    rep(i, n) cout << x[i] << " "; \
    cout << endl
#define debug2d(x, m, n)            \
    cout << "\n"                    \
         << #x << " is: \n";        \
    for (int i = 0; i < m; ++i)     \
    {                               \
        for (int j = 0; j < n; ++j) \
        {                           \
            cout << x[i][j] << " "; \
        }                           \
        cout << endl;               \
    }
#define nl cout << endl

#define MOD 1000000007
template <class T> inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}

int N, M, K;
int ans;

signed main()
{
    //cin.tie(0);
    //ios::sync_with_stdio(false);
    //==============================================
    cin >> N >> M;

    ans = (N*2 + M*2 - 4)

    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:26: error: expected ';' before 'cout'
   53 |     ans = (N*2 + M*2 - 4)
      |                          ^
      |                          ;
   54 | 
   55 |     cout<<ans<<endl;
      |     ~~~~
Language: C++

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

#define LLINF (1LL<<60)
typedef long long ll;

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)

template<typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

template<typename T> inline T divrup(T a, T b) { if (a % b) return a/b+1; else return a/b;}

#define dbg_v1(i,V) do{cout<<"-v1----\n";rep(i,V.size())cout<<" "<<i<<"\t:"<<V[i]<<endl;cout<<endl;}while(0)
#define dbg_v2(i,k,V) do{cout<<"-v2----\n";rep(i,V.size()){rep(k,V[0].size())cout<<" "<<V[i][k];cout<<endl;}}while(0)

//C++14 (GCC 5.4.1)
int main() {
    ll N,M;
    cin >>N>>M;

    //-----------------------------------
    ll ans;
    if(N==1){
        if(M<=2) ans=0;
        else ans=M-2;
    }else if(M==1){
        if(N<=2) ans=0;
        else ans=N-2;

    }else if((N==2 && M==2)||(N==3 && M==2) (N==2 && M==3) ){
        ans=0;\
    }else{
        ans=(N-2)*(M-2);
    }

    cout << ans <<endl;
    return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:45: error: expression cannot be used as a function
   32 |     }else if((N==2 && M==2)||(N==3 && M==2) (N==2 && M==3) ){
      |                              ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
Language: C++

#include <iostream>

using namespace std;

int main(void)
{
    int N, M;
    cin >> N >> M;

    if (N > M)
    {
        int tmp = N;
        N = M;
        M = tmp;
    }

    if (N == 1 && M == 1)
    {
        cout << 1 << endl;
    }
    else if (N == 1 && M != 1)
    {
        cout << M - 2 << endl;
    }
    else if (N > 1 && M > 1)
    {
        cout << (N - 2)(M - 2) << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:24: error: expression cannot be used as a function
   27 |         cout << (N - 2)(M - 2) << endl;
      |                 ~~~~~~~^~~~~~~
Language: C++

int main(){
	ll a,b; cin >> a >> b;
	if (min(a,b)==1){
		if (max(a,b)==1){
			cout << 1 << endl;
		}else{
			cout << max(a,b) - 2 << endl;
		}
	}else{
		cout << (a-2)*(b-2) << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:9: error: 'll' was not declared in this scope
    2 |         ll a,b; cin >> a >> b;
      |         ^~
a.cc:2:17: error: 'cin' was not declared in this scope
    2 |         ll a,b; cin >> a >> b;
      |                 ^~~
a.cc:2:24: error: 'a' was not declared in this scope
    2 |         ll a,b; cin >> a >> b;
      |                        ^
a.cc:2:29: error: 'b' was not declared in this scope
    2 |         ll a,b; cin >> a >> b;
      |                             ^
a.cc:3:13: error: 'min' was not declared in this scope; did you mean 'main'?
    3 |         if (min(a,b)==1){
      |             ^~~
      |             main
a.cc:4:21: error: 'max' was not declared in this scope
    4 |                 if (max(a,b)==1){
      |                     ^~~
a.cc:5:25: error: 'cout' was not declared in this scope
    5 |                         cout << 1 << endl;
      |                         ^~~~
a.cc:5:38: error: 'endl' was not declared in this scope
    5 |                         cout << 1 << endl;
      |                                      ^~~~
a.cc:7:25: error: 'cout' was not declared in this scope
    7 |                         cout << max(a,b) - 2 << endl;
      |                         ^~~~
a.cc:7:49: error: 'endl' was not declared in this scope
    7 |                         cout << max(a,b) - 2 << endl;
      |                                                 ^~~~
a.cc:10:17: error: 'cout' was not declared in this scope
   10 |                 cout << (a-2)*(b-2) << endl;
      |                 ^~~~
a.cc:10:40: error: 'endl' was not declared in this scope
   10 |                 cout << (a-2)*(b-2) << endl;
      |                                        ^~~~
Language: C++

#include <bits/stdc++.h>
#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
#define acc(v) accumulate(v.begin(), v.end(), 0)
#define cinv(n,v) rep(i,n) cin >> v[i]
using namespace std;
const int INF = 1e9;
typedef long long ll;
typedef vector<int> vint;
typedef vector<string> vstr;
typedef vector<char> vchar;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
// const lint MOD = 998244353;
int x_pos[4] = {1,0,-1,0}, y_pos[4] = {0,1,0,-1};
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 a,b; cin >> a >> b;
	if(a==3 && b==3){
		cout << 1 << endl;
	}else 
	if (a <= 3 || b <= 3){
		if (min(a,b)%2==0)){
			cout << 0 << endl;
		}else{
			cout << a*b-min(a,b)*2 << endl;
		}
	}else {
		cout << a*b - (a+b)*2 + 4 << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:35: error: expected primary-expression before ')' token
   42 |                 if (min(a,b)%2==0)){
      |                                   ^
Language: C++

#include <bits/stdc++.h>
#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
#define acc(v) accumulate(v.begin(), v.end(), 0)
#define cinv(n,v) rep(i,n) cin >> v[i]
using namespace std;
const int INF = 1e9;
typedef long long ll;
typedef vector<int> vint;
typedef vector<string> vstr;
typedef vector<char> vchar;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
// const lint MOD = 998244353;
int x_pos[4] = {1,0,-1,0}, y_pos[4] = {0,1,0,-1};
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 a,b; cin >> a >> b;
	if (a < 3 && b < 3){
		cout << 0 << endl;
	}else if(min(a,b) < 3){
		if (min(a,b%2==0)){
			cout << 0 << endl;
		}else{
			cout << a*b-min(a,b)*2 << endl;
		}
	}else {
		cout << a*b - (a+b)*2 + 4 << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:24: error: no matching function for call to 'min(int&, bool)'
   41 |                 if (min(a,b%2==0)){
      |                     ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:41:24: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'bool')
   41 |                 if (min(a,b%2==0)){
      |                     ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:41:24: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   41 |                 if (min(a,b%2==0)){
      |                     ~~~^~~~~~~~~~
Language: C

#include <stdio.h>
#include <math.h>

int main() {
	long long int a, b;
	scanf("%lld%lld", &a, &b);
	printf("%lld", abs((a - 2) * (b - 2));
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:24: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
    7 |         printf("%lld", abs((a - 2) * (b - 2));
      |                        ^~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
    2 | #include <math.h>
  +++ |+#include <stdlib.h>
    3 | 
main.c:7:36: warning: 'abs' argument 1 type is 'long long int' where 'int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
    7 |         printf("%lld", abs((a - 2) * (b - 2));
      |                            ~~~~~~~~^~~~~~~~~
<built-in>: note: built-in 'abs' declared here
main.c:7:46: error: expected ')' before ';' token
    7 |         printf("%lld", abs((a - 2) * (b - 2));
      |               ~                              ^
      |                                              )
main.c:8:18: error: expected ';' before '}' token
    8 |         return 0;
      |                  ^
      |                  ;
    9 | }
      | ~
Language: Java

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

int main(void)
{
  int N, M;
  scanf("%d%d", &N, &M);
  long ans = abs((N-2)*(M-2));
  printf("%ld\n", ans);
  return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
         ^
Main.java:2: error: illegal character: '#'
#include <stdlib.h>
^
Main.java:7: error: class, interface, enum, or record expected
  scanf("%d%d", &N, &M);
  ^
Main.java:8: error: unnamed classes are a preview feature and are disabled by default.
  long ans = abs((N-2)*(M-2));
  ^
  (use --enable-preview to enable unnamed classes)
Main.java:9: error: class, interface, enum, or record expected
  printf("%ld\n", ans);
  ^
Main.java:10: error: class, interface, enum, or record expected
  return 0;
  ^
Main.java:11: error: class, interface, enum, or record expected
}
^
8 errors
Language: C++

#include <bits/stdc++.h>

#define foreach(i, v) for(__typeof((v).begin()) i = (v).begin(); i != (v).end(); ++ i)
#define BETWEEN(a, x, b) (a<=x&&x<b)

using namespace std;
typedef long long ll;

int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

  ll n,m;cin>>n>>m;
  if(n==1&&m==1){cout<<1<<endl;}
  else if(m==1) {cout<<(n-2)<<endl;}
  else if(n==1) {cout<<(m-2)<<endl;}
  else {cout<<(n-2)*(m-2)<<endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
a.cc:9:34: note: to match this '{'
    9 | int main(int argc, char *argv[]) {
      |                                  ^
Language: C++

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

int main() {
  int n,m;
  cin >> n >> m;
  if(n==1 && m==1){
    cout << 1 << endl;
  }elseif(n==1 || m==1){
    cout << max(n,m)-2 << endl;
  }else{
    cout << (n-2)*(m-2) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:4: error: 'elseif' was not declared in this scope
    9 |   }elseif(n==1 || m==1){
      |    ^~~~~~
a.cc:11:4: error: 'else' without a previous 'if'
   11 |   }else{
      |    ^~~~
Language: C++

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

int main() {
  int n,m;
  cin >> n >> m;
  if(n==1 && n==1){
    cout << 1 << endl;
  }elseif(n==1 || m==1){
    cout << max(n,m)-2 << endl;
  }else{
    cout << (n-2)*(m-2) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:4: error: 'elseif' was not declared in this scope
    9 |   }elseif(n==1 || m==1){
      |    ^~~~~~
a.cc:11:4: error: 'else' without a previous 'if'
   11 |   }else{
      |    ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <set> 
#include <map>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstring>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); ++i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
typedef long long ll;
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

int main () {

    ll n,m; cin >>n>>m;

    ll res = 0;
    if(n <= 2 && m > 2) {
        res = n*m - 2*n; 
    } else if (n > 2 && m <= 2) {
        res = n*m - 2*m;
    } else if (n == 1 && m == 1) {
        res = 1;
    } else {
        res = n*m - (n*m - (n-2)*(m-2))
    } 

    cout << res << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:32:40: error: expected ';' before '}' token
   32 |         res = n*m - (n*m - (n-2)*(m-2))
      |                                        ^
      |                                        ;
   33 |     }
      |     ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){ 
int n,m;cin>>n>>m;
  if(n>2&&m>2)cout<<(n-2)*(m-2)<<endl;
   else if(n==2&&m>2)cout<<n*m<<endl;
  else if(n>2&&m==2)cout<<n*m<<endl;
  else if(n==1&&m>2)cout<<m-2<<endl;
  else if(n>2&&m==1)cout<<n-2<<endl;
  else if(n==2&&m==2)cout<<4<<endl;
   elseif(n==1&&m==1)cout<<1<<endl;
  else cout<<0<<endl;
}
    
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:11:4: error: 'elseif' was not declared in this scope
   11 |    elseif(n==1&&m==1)cout<<1<<endl;
      |    ^~~~~~
a.cc:12:3: error: 'else' without a previous 'if'
   12 |   else cout<<0<<endl;
      |   ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll n,m;
  cin>>n>>m;
  if(n>2&&m>2){
    	cout<<(n-2)*(m-2)<<endl;
  }else if(n==2||m==2){
    	cout<<0<<endl;
  }else{
    	cout<<max(0,max(n,m)-2)<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: no matching function for call to 'max(int, long long int)'
   12 |         cout<<max(0,max(n,m)-2)<<endl;
      |               ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:12:18: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   12 |         cout<<max(0,max(n,m)-2)<<endl;
      |               ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:12:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   12 |         cout<<max(0,max(n,m)-2)<<endl;
      |               ~~~^~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;

int main() {
ll m,n 
  cin>>m>>n;
  if(m>=3&&n>=3){
  cout<<m*n-(2*m+2*n-8);}
  else if(m==2&&n==2){
    cout<<4<<endl;}
  else if(m==2||n==2){
    cout<<4;}
  else if(m==1&&n==1){
    cout<<0<<endl;}
  else cout<<m*n-2<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected initializer before 'cin'
    9 |   cin>>m>>n;
      |   ^~~
a.cc:10:12: error: 'n' was not declared in this scope
   10 |   if(m>=3&&n>=3){
      |            ^
Language: C++

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

#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() {
  ll n,m;
  cin >> n >> m;
  cout << abs((n-2)(m-2));
  
  
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:20: error: expression cannot be used as a function
   20 |   cout << abs((n-2)(m-2));
      |               ~~~~~^~~~~
Language: C++

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

#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() {
  ll n,m
  cin >> n >> m;
  cout << abs((n-2)(m-2));
  
  
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: expected initializer before 'cin'
   19 |   cin >> n >> m;
      |   ^~~
a.cc:20:21: error: 'm' was not declared in this scope
   20 |   cout << abs((n-2)(m-2));
      |                     ^
a.cc:20:24: error: expression cannot be used as a function
   20 |   cout << abs((n-2)(m-2));
      |                        ^
Language: C

#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
using namespace std;
int main()
{
  int n,m;
  long long int ans;
  cin>>n>>m;

  cout<<abs(m-2)*abs(n-2)<<endl;
}

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

/* << IN THE NAME OF GOD >> */
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define pob pop_back
#define ft first
#define sc second
#define err(x) cerr << #x  << " = "<<  x << '\n'
#define out(x) cout << x << '\n'
#define forp(i, r, l) for(int i = int(r); i < int(l); i++)
#define forn(i, r, l) for(int i = int(r); i > int(l); i--)
#define FAST ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
#define ctz __builtin_ctz
typedef pair<int, int> pii;
const int maxn = 1e6;
 

int n ,m ,res;

int main(){FAST;
          
	cin >> n >> m;
	if(n>m) swap(n,m);
	if(n==1 && m==1) cout << 1 << endl;
	else if(n==1) cout << m-2 << endl;
	else cout << (n-2)*(m-2) << en
   return 0;
}
 



Compiler output:
a.cc: In function 'int main()':
a.cc:27:37: error: 'en' was not declared in this scope; did you mean 'yn'?
   27 |         else cout << (n-2)*(m-2) << en
      |                                     ^~
      |                                     yn
Language: C++

#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <map>
#include <vector>
using namespace std;

int main(int argc, char const *argv[]) {
  long long int N, M;
  cin >> N >> M;

  if (N != 1 && M != 1) {
    long long int ans = (N - 2) * (M - 2);
    cout << ans << endl;
    return 0;
  } else if (N * M == 1) {
    cout << 1 << endl;
  }else {
    long long int ans = max(N * M - 2, 0);
    cout << ans << endl;
    return 0;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:20:28: error: no matching function for call to 'max(long long int, int)'
   20 |     long long int ans = max(N * M - 2, 0);
      |                         ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:20:28: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   20 |     long long int ans = max(N * M - 2, 0);
      |                         ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:20:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   20 |     long long int ans = max(N * M - 2, 0);
      |                         ~~~^~~~~~~~~~~~~~
Language: C++

#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <map>
#include <vector>
using namespace std;

int main(int argc, char const *argv[]) {
  int N, M;
  cin >> N >> M;

  if (N != 1 && M != 1) {
    int ans = (N - 2) * (M - 2);
    cout << ans << endl;
    return 0;
    else if (N * M == 1) {
      cout << 1 << endl;
    }
  } else {
    int ans = max(N * M - 2, 0);
    cout << ans << endl;
    return 0;
  }
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:17:5: error: expected '}' before 'else'
   17 |     else if (N * M == 1) {
      |     ^~~~
a.cc:13:25: note: to match this '{'
   13 |   if (N != 1 && M != 1) {
      |                         ^
a.cc: At global scope:
a.cc:20:5: error: expected unqualified-id before 'else'
   20 |   } else {
      |     ^~~~
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C++

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

int main () 
{
	long n, m;
	cin >> n >> m;
	if(n == 1  || m == 1)
    {
		if(n == 1 && m == 1)
        {
			cout << 1;
		}
        else
        {
			cout << max(0,(long)(n + m - 3)) << endl;
		}
	}
    else if(n == 2 || m == 2)
    {
		cout << 0;
	}
    else
    {
		long tmp = 0;
		tmp = (n-2) * (m-2);
		cout << tmp;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:36: error: no matching function for call to 'max(int, long int)'
   16 |                         cout << max(0,(long)(n + m - 3)) << endl;
      |                                 ~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:16:36: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long int')
   16 |                         cout << max(0,(long)(n + m - 3)) << endl;
      |                                 ~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:16:36: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   16 |                         cout << max(0,(long)(n + m - 3)) << endl;
      |                                 ~~~^~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main () {
	long long N,M;
	cin >> N >> M;
	if(N == 1  || M == 1){
		cout << max(0,N + M - 3) << endl;
	}else if(N == 2 || M == 2){
		cout << 0 << endl;
	}else{
		long long tmp = 0;
		tmp = (N-2) * (M-2);
		cout << tmp << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:28: error: no matching function for call to 'max(int, long long int)'
    7 |                 cout << max(0,N + M - 3) << endl;
      |                         ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:7:28: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
    7 |                 cout << max(0,N + M - 3) << endl;
      |                         ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:7:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
    7 |                 cout << max(0,N + M - 3) << endl;
      |                         ~~~^~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define double long double
#define int long long
#define inf 1000000007 
#define rep(i,n) for(int i=0;i<n;i++)
signed main(){
	int n,m;
	cin>>n>>m;
	if(n<2&&m<2){cout<<1<<endl;}
	else if(n>2&&m>2)cout<<(n-2)*(m-2)<<endl;
	else cout<<<max(n,m)-2<endl;
}
	


Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: expected primary-expression before '<' token
   12 |         else cout<<<max(n,m)-2<endl;
      |                    ^
Language: C++

#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
    int n, m;
    cin >> n >> m;
    ll ans = 0;
    
    if (n == 1 && m == 1) {
        ans = 1;
    }else if(n == 1){
        ans = m - 2;
    }else if(m == 1){
        ans = n - 2;
    }else{
        ans = (n-2) * (m-2);
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:6:5: error: 'll' was not declared in this scope
    6 |     ll ans = 0;
      |     ^~
a.cc:9:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |         ans = 1;
      |         ^~~
      |         abs
a.cc:11:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |         ans = m - 2;
      |         ^~~
      |         abs
a.cc:13:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |         ans = n - 2;
      |         ^~~
      |         abs
a.cc:15:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |         ans = (n-2) * (m-2);
      |         ^~~
      |         abs
a.cc:17:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

#include<iostream>
#include<set>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#include <algorithm>
using namespace std;
#include <cmath>
#include <string>
#define elif else if

void printBoard(bool *board,int N,int M ){
  for(int i=1;i<N+1;i++){
    for(int j=1;j<M+1;j++){
      cout<<board[i][j]<<" ";
    }
    count<<endl;
  }

}


int main(void) {
  ios::sync_with_stdio(false);
  int N,M;
  cin>>N>>M;

  //bool c[N][M] = {true};
  bool c[N+2][M+2];
  rep(i,N+2){
    rep(j,M+2){
      c[i][j] = true;
    }
  }

  //flip作業
  for(int i= 1;i<N+1;i++){
    for(int j=1;j<M+1;j++){

        c[i-1][j-1] != c[i-1][j-1];
        c[i-1][j] != c[i-1][j];
        c[i-1][j+1] != c[i-1][j+1];

        c[i][j-1] != c[i][j-1];
        c[i][j] != c[i][j];
        c[i][j+1] != c[i][j+1];

        c[i+1][j-1] != c[i+1][j-1];
        c[i+1][j] != c[i+1][j];
        c[i+1][j+1] != c[i+1][j+1];

    }
    //printBoard(c, N ,M );
  }




  int count=0;
  for(int i= 1;i<N+1;i++){
    for(int j=1;j<M+1;j++){
      if(c[i][j])
        count++;

    }
  }

  cout<<count<<endl;
//cout<<sizeof(c)<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'void printBoard(bool*, int, int)':
a.cc:13:21: error: invalid types 'bool[int]' for array subscript
   13 |       cout<<board[i][j]<<" ";
      |                     ^
a.cc:15:10: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator<<'
   15 |     count<<endl;
      |     ~~~~~^~~~~~