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


#include <set>
#include <string>
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <limits>
#include <map>
#include <numeric>

#define ll long long
using namespace std;
static ll imin = std::numeric_limits<ll>::min();
static ll imax = std::numeric_limits<ll>::max();
#define rep(i, n) for(int i = 0; i<n; ++i)
#define rep1(i, n) for(int i = 1; i<n; ++i)
#define rev_rep(i, n) for(int i = n - 1; i >= 0; --i)
#define dump(x) cout << #x << ":" << x << "\n";
#define all(v) v.begin(), v.end()

template<class T1, class T2>
std::ostream& operator << (std::ostream& os, std::pair<T1, T2>& pair){
  os << '(' << pair.first << ',' << pair.second << ')';
  return os;
}
template<class T>
std::ostream& operator << (std::ostream& os, std::vector<T>& vec){
  std::size_t n = vec.size();
  if(n == 0){
    return os;
  }
  os << " ";
  for(int i = 0; i<n - 1; ++i){
    os << vec[i] << " ";
  }
  os << vec[n - 1];
  os << std::endl;
  return os;
}


#ifndef BOOST_TEST_MAIN
int main(int const argc, char const** argv){
  ll W, H;
  cin >> W >> H;
  if(W == 1){
    cout << H - 2;
    return;
  }
  if(H == 1){
    cout << W - 2;
    return;
  }

  cout << (W - 2) * (H - 2);
  
}
#endif


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:50:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   50 |     return;
      |     ^~~~~~
a.cc:54:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   54 |     return;
      |     ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))

#define SORT(arr) sort(arr, arr + ARRAY_LENGTH(arr))

int N,M;
int main(){
	cin >> N >> M;
	if(N == M){
		if(N == 1)cout << 1 << endl;
		else cout << (N-2)*(N-2) << endl;
	}
	else if(min(N,M) == 1) {
		else cout << max(N,M)-2 << endl;
	}else if (min(N,M) == 2){
		cout << 0 << endl;
	}else{
		cout << N*M - (2*N +2*(M-2)) << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: expected '}' before 'else'
   15 |                 else cout << max(N,M)-2 << endl;
      |                 ^~~~
a.cc:14:32: note: to match this '{'
   14 |         else if(min(N,M) == 1) {
      |                                ^
a.cc: At global scope:
a.cc:16:10: error: expected unqualified-id before 'else'
   16 |         }else if (min(N,M) == 2){
      |          ^~~~
a.cc:18:10: error: expected unqualified-id before 'else'
   18 |         }else{
      |          ^~~~
a.cc:21:9: error: expected unqualified-id before 'return'
   21 |         return 0;
      |         ^~~~~~
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

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


Compiler output:
a.cc: In function 'int mai()':
a.cc:11:1: warning: no return statement in function returning non-void [-Wreturn-type]
   11 | }
      | ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
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)
#define INF 10000000000

int main(){
cin.tie(0);
ios::sync_with_stdio(false);
	int N,M;
	cin>>N>>M;
	if(N>2 && M>2)
		cout<<(N-2)*(M-2)<<endl;
	else if(N==1 && M==1)
		cout<<"1"<<endl;
	else(N==1 || M==1)
		cout<<max(N,M)-2<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:27: error: expected ';' before 'cout'
   19 |         else(N==1 || M==1)
      |                           ^
      |                           ;
   20 |                 cout<<max(N,M)-2<<endl;
      |                 ~~~~
Language: C++

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

void my_reverse(int **cell, int i, int j) {
	if (cell[i][j] == 0) {
		cell[i][j] = 1;
	} else {
		cell[i][j] = 0;
	}
}

int main() {
	int N, M;
	cin >> N >> M;
	int **cell = malloc(sizeof(int) * (N+1)*(M+1));
	for (int i = 1; i <= N; i++) {
		for (int j = 0; j <= M; j++) {
			if (j-1 >= 1) {
				my_reverse(cell, i, j-1);
				if (i-1 >= 1) {
					my_reverse(cell, i-1, j-1);
				}
				if (i+1 <= N) {
					my_reverse(cell, i+1, j-1);
				}
			}
			if (i-1 >= 1) {
				my_reverse(cell, i-1, j);
			}
			if (i+1 <= M) {
				my_reverse(cell, i+1, j);
			}

			if (j+1 <= M) {
				my_reverse(i, j+1);
				if (i-1 >= 1) {
					my_reverse(cell, i-1, j+1);
				}
				if (i+1 <= N) {
					my_reverse(cell, i+1, j+1);
				}
			}
		}
	}

	int sum = 0;
	for (int i = 1; i <= N; i++) {
		for (int j = 1; j <= M; j++) {
			sum += cell[i][j];
		}
	}

	cout << sum << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:28: error: invalid conversion from 'void*' to 'int**' [-fpermissive]
   15 |         int **cell = malloc(sizeof(int) * (N+1)*(M+1));
      |                      ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                            |
      |                            void*
a.cc:35:44: error: invalid conversion from 'int' to 'int**' [-fpermissive]
   35 |                                 my_reverse(i, j+1);
      |                                            ^
      |                                            |
      |                                            int
a.cc:35:43: error: too few arguments to function 'void my_reverse(int**, int, int)'
   35 |                                 my_reverse(i, j+1);
      |                                 ~~~~~~~~~~^~~~~~~~
a.cc:4:6: note: declared here
    4 | void my_reverse(int **cell, int i, int j) {
      |      ^~~~~~~~~~
Language: C++

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

void reverse(int **cell, int i, int j) {
	if (cell[i][j] == 0) {
		cell[i][j] = 1;
	} else {
		cell[i][j] = 0;
	}
}

int main() {
	int N, M;
	cin >> N >> M;
	int cell[N+1][M+1];
	for (int i = 1; i <= N; i++) {
		for (int j = 0; j <= M; j++) {
			if (j-1 >= 1) {
				reverse(i, j-1);
				if (i-1 >= 1) {
					reverse(i-1, j-1);
				}
				if (i+1 <= N) {
					reverse(i+1, j-1);
				}
			}
			if (i-1 >= 1) {
				reverse(i-1, j);
			}
			if (i+1 <= M) {
				reverse(i+1, j);
			}

			if (j+1 <= M) {
				reverse(i, j+1);
				if (i-1 >= 1) {
					reverse(i-1, j+1);
				}
				if (i+1 <= N) {
					reverse(i+1, j+1);
				}
			}
		}
	}

	int sum = 0;
	for (int i = 1; i <= N; i++) {
		for (int j = 1; j <= M; j++) {
			sum += cell[i][j];
		}
	}

	cout << sum << endl;
	return 0;
}

Compiler output:
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::reverse(_BIter, _BIter) [with _BIter = int]':
a.cc:19:12:   required from here
   19 |                                 reverse(i, j-1);
      |                                 ~~~~~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1089:63: error: no matching function for call to '__iterator_category(int&)'
 1089 |       std::__reverse(__first, __last, std::__iterator_category(__first));
      |                                       ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:65,
                 from /usr/include/c++/14/algorithm:60:
/usr/include/c++/14/bits/stl_iterator_base_types.h:239:5: note: candidate: 'template<class _Iter> constexpr typename std::iterator_traits< <template-parameter-1-1> >::iterator_category std::__iterator_category(const _Iter&)'
  239 |     __iterator_category(const _Iter&)
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:239:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_iterator_base_types.h: In substitution of 'template<class _Iter> constexpr typename std::iterator_traits< <template-parameter-1-1> >::iterator_category std::__iterator_category(const _Iter&) [with _Iter = int]':
/usr/include/c++/14/bits/stl_algo.h:1089:63:   required from 'void std::reverse(_BIter, _BIter) [with _BIter = int]'
 1089 |       std::__reverse(__first, __last, std::__iterator_category(__first));
      |                                       ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
a.cc:19:12:   required from here
   19 |                                 reverse(i, j-1);
      |                                 ~~~~~~~^~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:239:5: error: no type named 'iterator_category' in 'struct std::iterator_traits<int>'
  239 |     __iterator_category(const _Iter&)
      |     ^~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  cin >> n >> m;
  cout << (n-2)*(m-2) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:10: error: 'n' was not declared in this scope
    4 |   cin >> n >> m;
      |          ^
a.cc:4:15: error: 'm' was not declared in this scope; did you mean 'tm'?
    4 |   cin >> n >> m;
      |               ^
      |               tm
Language: C++

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

int main(){
    int n,m;
    long long ans;
    scanf("%d %d",&n,&m);
    if (n==1 && m==1) ans=1;
    else if (min(n,m)==1) ans=max(max(n,m)-2);
    else ans=(n-2)*(m-2);
    printf("%lld\n",ans);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:34: error: no matching function for call to 'max(int)'
    9 |     else if (min(n,m)==1) ans=max(max(n,m)-2);
      |                               ~~~^~~~~~~~~~~~
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:   candidate expects 2 arguments, 1 provided
/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, 1 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:   template argument deduction/substitution failed:
a.cc:9:34: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
    9 |     else if (min(n,m)==1) ans=max(max(n,m)-2);
      |                               ~~~^~~~~~~~~~~~
/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:   candidate expects 2 arguments, 1 provided
Language: C++

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

int main(){
    int n,m;
    scanf("%d %d",&n,&m);
    print("%lld\n",(n==1 || m==1)?max(0,min(n-2,m-2)):(n-2)*(m-2));

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'print' was not declared in this scope; did you mean 'rint'?
    7 |     print("%lld\n",(n==1 || m==1)?max(0,min(n-2,m-2)):(n-2)*(m-2));
      |     ^~~~~
      |     rint
Language: C

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <stdio.h>
using namespace std;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPL(i,f,n) for(int i=f, i##_len=(n); i<i##_len; ++i)
typedef long long ll;

int main() {
	string MARCH = "MARCH";
	cin.tie(0);
	ios::sync_with_stdio(false);

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


Compiler output:
main.c:2:10: fatal error: iostream: No such file or directory
    2 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
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==1 && M>=2){cout << M-2 << endl;}
  else if(N==1 && M==1){cout << 1 << endl;}
  else if(M==1 && N>=2){cout << N-2 << endl;}
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:33: error: expression cannot be used as a function
    7 |   if(N>=2 && M>=2){cout << (N-2)(M-2) << endl;}
      |                            ~~~~~^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N, M;
  cin >> N >> M;
  if(M != 1){
  switch(N){
    case 1: cout << M-2 << endl; break;
    case 2: cout << 0 << endl; break;
    default: cout << (N-2)*(M-2) << endl;
  }
  }else{
  switch(N){
    case 1: cout << 1 << endl; break;
    case 2: cout << 0 << endl; break;
    default: cout << N-2 << endl;
  }
}

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

#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	long n,m;
  	cin>>n>>m;
	cout<<max(1,n-2)*max(1,m-2)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: no matching function for call to 'max(int, long int)'
    8 |         cout<<max(1,n-2)*max(1,m-2)<<endl;
      |               ~~~^~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:8:18: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long int')
    8 |         cout<<max(1,n-2)*max(1,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
a.cc:8:29: error: no matching function for call to 'max(int, long int)'
    8 |         cout<<max(1,n-2)*max(1,m-2)<<endl;
      |                          ~~~^~~~~~~
/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:8:29: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long int')
    8 |         cout<<max(1,n-2)*max(1,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
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	long n,m;
	cout<<max(1,n-2)*max(1,m-2)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: no matching function for call to 'max(int, long int)'
    7 |         cout<<max(1,n-2)*max(1,m-2)<<endl;
      |               ~~~^~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:18: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long int')
    7 |         cout<<max(1,n-2)*max(1,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
a.cc:7:29: error: no matching function for call to 'max(int, long int)'
    7 |         cout<<max(1,n-2)*max(1,m-2)<<endl;
      |                          ~~~^~~~~~~
/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:29: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long int')
    7 |         cout<<max(1,n-2)*max(1,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
Language: C++

#include <iostream>
#include
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  cout << abs((m - 2) * (n - 2)) << endl;
}

Compiler output:
a.cc:2:9: error: #include expects "FILENAME" or <FILENAME>
    2 | #include
      |         ^
Language: Java

import java.util.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(in);
  int n=sc.nextInt();
  int m=sc.nextInt();
int temp1=max(m,n);
int temp2=min(m,n);
n=temp1;
m=temp2;
long ans=0;
if(m==1&&n==1){
ans=1;
}else if(m==1){
ans=n-2;
}else{
ans=(m-2)*(n-2);
}
outt.println(ans);
}
}


Compiler output:
Main.java:21: error: cannot find symbol
outt.println(ans);
^
  symbol:   variable outt
  location: class Main
1 error
Language: Java

import java.util.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(in);
  int n=sc.nextInt();
  int m=sc.nextInt();
m=min(m,n);
n=max(m,n);
long ans=0;
if(m==1&&n==1){
ans=1;
}else if(m==1){
ans=n-2;
}else{
ans=(m-2)*(n-2);
}
outt.println(ans);
}
}


Compiler output:
Main.java:19: error: cannot find symbol
outt.println(ans);
^
  symbol:   variable outt
  location: class Main
1 error
Language: C++

import java.util.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(in);
  int n=sc.nextInt();
  int m=sc.nextInt();
m=min(m,n);
n=max(m,n);
long ans=0;
if(m==1&&n==1){
ans=1;
}else if(m==1){
ans=n-2;
}else{
ans=(m-2)*(n-2);
}
outt.println(ans);
}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import static java.lang.System.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import static java.lang.Math.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public class Main {
      | ^~~~~~
Language: C++

#include<cstdio>
#include<cstdlib>
using namespace std;

int main(){
  int n, m;
  scanf("%d%d",&n, &m);
  printf("%d\n",abs((n-2)*(m-2));
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:33: error: expected ')' before ';' token
    8 |   printf("%d\n",abs((n-2)*(m-2));
      |         ~                       ^
      |                                 )
Language: C++

#include <cstdio>

int N, M;

int main()
{
    scanf("%d %d", &N, &M);


    int ans = 0;

    if(N >= 3 && M >= 3){
      ans = (N - 2) * (M - 2);
      printf("%d", ans);
      return 0;
    }
    if(N % 2 == 0 || M % 2 == 0){
      printf("0");
      return 0;
    }
    if(N == 1 && M == 1){
      ans = N*M - 2;
      printf("%d", ans);
      return 0;
    }

    printf("1")


}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:16: error: expected ';' before '}' token
   27 |     printf("1")
      |                ^
      |                ;
......
   30 | }
      | ~
Language: C++

#include<iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <tuple>
#include <cmath>
#include <queue>
#include <vector>
#include <map>
using namespace std;

#define ll int64_t
const long MOD = 1e9 + 7;


// 自作のソート関数
// 5で割った余りの大小で比較
bool less_second(const pair<int, long>& lhs, const pair<int, long>& rhs) {
  return lhs.second > rhs.second;
}


int main()
{
  //#####  // 左上はmax4回 左2上はmax6回
  //#####  // 2段目はmax6回 2段目真ん中はmax9回
  //#####

  // 最終的にみたいな
  //###
  //#.#
  //#.#
  //###
  long n, m;

  cin  >> ans >> m;
  long ans =0;
  if (m==1){
    ans = max(n-2,(long)0);
  }else if (m>=3){
    ans = (m-2) * (n-2);
  }






  cout << ans;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   36 |   cin  >> ans >> m;
      |           ^~~
      |           abs
Language: C++

#include<iostream>
#include<algorithm>
#include<math.h>
#include<cstring>
#include<set>
#include<vector>
#include<map>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<numeric>
#include<string>
typedef long long ll;
using namespace std;
int main() {
	ll N, M;
	cin >> N >> M;
  	cout<<abs((N-2)*(M-2))<<endl;
}






　　

Compiler output:
a.cc:28:1: error: extended character 　 is not valid in an identifier
   28 | 　　
      | ^
a.cc:28:1: error: extended character 　 is not valid in an identifier
a.cc:28:1: error: '\U00003000\U00003000' does not name a type
   28 | 　　
      | ^~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
  int n, m, ans;
  cin >> n >> m;
  cou << (n-2)*(m-2)<0?-(n-2)*(m-2):(n-2)*(m-2) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cou' was not declared in this scope
    7 |   cou << (n-2)*(m-2)<0?-(n-2)*(m-2):(n-2)*(m-2) << endl;
      |   ^~~
a.cc:7:49: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    7 |   cou << (n-2)*(m-2)<0?-(n-2)*(m-2):(n-2)*(m-2) << endl;
      |                                     ~~~~~~~~~~~~^~~~~~~
Language: C++

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

using namespace std;

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

    long long ans = 0;
    if (N => 3 && M >= 3)ans = N*M - ((N*2) + (M*2) -4);
    else if ((N => 2 || M >= 2))ans = 0;
    else if ((N == 1 || M == 1)) ans = N*M - 2;
    else ans = 1;
    cout<<ans<<endl;
    
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: expected primary-expression before '>' token
   14 |     if (N => 3 && M >= 3)ans = N*M - ((N*2) + (M*2) -4);
      |            ^
a.cc:15:18: error: expected primary-expression before '>' token
   15 |     else if ((N => 2 || M >= 2))ans = 0;
      |                  ^
Language: C

#include <cstdio>
#include <algorithm>
using std::min;
using std::max;
int main(void)
{
	int N,M;
	scanf("%d%d",&N,&M);
	if(M==1 && N==1)
		printf("1\n");
	else if(min(M,N)==1)
		printf("%d\n",max(M,N)-2);
	else
		printf("%d\n",(M-2)*(N-2));

	return 0;

}

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

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

int main()
{
  int a, b, cnt = 0;

  cin >> a >> b;

  for(int i = a; i <= b; i++){
    string suu = tostring(i);
    
    if(suu[0] == suu[4] && suu[1] == suu[3])
      cnt++;
  }
  cout << cnt <<endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: 'tostring' was not declared in this scope
   14 |     string suu = tostring(i);
      |                  ^~~~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: expression cannot be used as a function
    8 |   else ans=(a-2)(b-2);
      |            ~~~~~^~~~~
Language: C

#include<math.h>
long a,b;main(){scanf("%ld%ld",&a,&b);printf("%ld",labs((a-2)*(b-2));}

Compiler output:
main.c:2:10: error: return type defaults to 'int' [-Wimplicit-int]
    2 | long a,b;main(){scanf("%ld%ld",&a,&b);printf("%ld",labs((a-2)*(b-2));}
      |          ^~~~
main.c: In function 'main':
main.c:2:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    2 | long a,b;main(){scanf("%ld%ld",&a,&b);printf("%ld",labs((a-2)*(b-2));}
      |                 ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    1 | #include<math.h>
  +++ |+#include <stdio.h>
    2 | long a,b;main(){scanf("%ld%ld",&a,&b);printf("%ld",labs((a-2)*(b-2));}
main.c:2:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    2 | long a,b;main(){scanf("%ld%ld",&a,&b);printf("%ld",labs((a-2)*(b-2));}
      |                 ^~~~~
main.c:2:17: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:2:39: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    2 | long a,b;main(){scanf("%ld%ld",&a,&b);printf("%ld",labs((a-2)*(b-2));}
      |                                       ^~~~~~
main.c:2:39: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:2:39: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:2:39: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:2:52: error: implicit declaration of function 'labs' [-Wimplicit-function-declaration]
    2 | long a,b;main(){scanf("%ld%ld",&a,&b);printf("%ld",labs((a-2)*(b-2));}
      |                                                    ^~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'labs'
    1 | #include<math.h>
  +++ |+#include <stdlib.h>
    2 | long a,b;main(){scanf("%ld%ld",&a,&b);printf("%ld",labs((a-2)*(b-2));}
main.c:2:52: warning: incompatible implicit declaration of built-in function 'labs' [-Wbuiltin-declaration-mismatch]
    2 | long a,b;main(){scanf("%ld%ld",&a,&b);printf("%ld",labs((a-2)*(b-2));}
      |                                                    ^~~~
main.c:2:52: note: include '<stdlib.h>' or provide a declaration of 'labs'
main.c:2:69: error: expected ')' before ';' token
    2 | long a,b;main(){scanf("%ld%ld",&a,&b);printf("%ld",labs((a-2)*(b-2));}
      |                                             ~                       ^
      |                                                                     )
main.c:2:70: error: expected ';' before '}' token
    2 | long a,b;main(){scanf("%ld%ld",&a,&b);printf("%ld",labs((a-2)*(b-2));}
      |                                                                      ^
      |                                                                      ;
Language: C++

#include<math.h>
long a,b;main(){scanf("%ld%ld",&a,&b);printf("%ld",labs((a-2)*(b-2));}

Compiler output:
a.cc:2:10: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | long a,b;main(){scanf("%ld%ld",&a,&b);printf("%ld",labs((a-2)*(b-2));}
      |          ^~~~
a.cc: In function 'int main()':
a.cc:2:17: error: 'scanf' was not declared in this scope
    2 | long a,b;main(){scanf("%ld%ld",&a,&b);printf("%ld",labs((a-2)*(b-2));}
      |                 ^~~~~
a.cc:2:69: error: expected ')' before ';' token
    2 | long a,b;main(){scanf("%ld%ld",&a,&b);printf("%ld",labs((a-2)*(b-2));}
      |                                             ~                       ^
      |                                                                     )
Language: C++

#include<math.h>
long a,b;main(){std::cin>>a>>b;std::cout<<labs((a-2)*(b-2));}

Compiler output:
a.cc:2:10: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | long a,b;main(){std::cin>>a>>b;std::cout<<labs((a-2)*(b-2));}
      |          ^~~~
a.cc: In function 'int main()':
a.cc:2:22: error: 'cin' is not a member of 'std'
    2 | long a,b;main(){std::cin>>a>>b;std::cout<<labs((a-2)*(b-2));}
      |                      ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<math.h>
  +++ |+#include <iostream>
    2 | long a,b;main(){std::cin>>a>>b;std::cout<<labs((a-2)*(b-2));}
a.cc:2:37: error: 'cout' is not a member of 'std'
    2 | long a,b;main(){std::cin>>a>>b;std::cout<<labs((a-2)*(b-2));}
      |                                     ^~~~
a.cc:2:37: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C

#include<bits/stdc++.h>
long a,b;main(){std::cin>>a>>b;std::cout<<labs((a-2)*(b-2))<<'\n';}

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

#include<math.h>
main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
      | ^~~~
main.c: In function 'main':
main.c:2:1: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:2:11: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    2 | main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
      |           ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    1 | #include<math.h>
  +++ |+#include <stdio.h>
    2 | main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
main.c:2:11: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    2 | main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
      |           ^~~~~
main.c:2:11: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:2:31: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    2 | main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
      |                               ^~~~~~
main.c:2:31: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:2:31: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:2:31: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:2:46: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
    2 | main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
      |                                              ^~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
    1 | #include<math.h>
  +++ |+#include <stdlib.h>
    2 | main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
main.c:2:61: warning: 'abs' argument 1 type is 'long int' where 'int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
    2 | main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
      |                                                  ~~~~~~~~~~~^~~~~~
<built-in>: note: built-in 'abs' declared here
main.c:2:68: error: expected ')' before ';' token
    2 | main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
      |                                     ~                              ^
      |                                                                    )
main.c:2:69: error: expected ';' before '}' token
    2 | main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
      |                                                                     ^
      |                                                                     ;
Language: C++

#include<math.h>
main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}

Compiler output:
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token
    2 | main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
      |     ^
Language: C++

#include <bits/stdc++.h>
#include <string>
#include <stdio.h>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
using namespace std;

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

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

      cout<<(N-2)*(M-2)<<endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: expected identifier before '(' token
   22 |     if((N==1))&&(M>=2)){
      |                 ^
Language: C

#include<math.h>
a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}

Compiler output:
main.c:2:1: warning: data definition has no type or storage class
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
      | ^
main.c:2:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:2:3: error: return type defaults to 'int' [-Wimplicit-int]
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
      |   ^~~~
main.c: In function 'main':
main.c:2:3: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:2:11: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
      |           ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    1 | #include<math.h>
  +++ |+#include <stdio.h>
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
main.c:2:11: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
      |           ^~~~~
main.c:2:11: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:2:31: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
      |                               ^~~~~~
main.c:2:31: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:2:31: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:2:31: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:2:46: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
      |                                              ^~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
    1 | #include<math.h>
  +++ |+#include <stdlib.h>
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
main.c:2:61: warning: 'abs' argument 1 type is 'long int' where 'int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
      |                                                  ~~~~~~~~~~~^~~~~~
<built-in>: note: built-in 'abs' declared here
main.c:2:68: error: expected ')' before ';' token
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
      |                                     ~                              ^
      |                                                                    )
main.c:2:69: error: expected ';' before '}' token
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((long)(a-2)*(b-2));}
      |                                                                     ^
      |                                                                     ;
Language: C

#include<bits/stdc++.h>
long a,b,c;main(){std::cin>>a>>b;c=(a-2)*(b-2);std::cout<<abs(c)<<'\n';}

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

#include<math.h>
a,b;main(){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}

Compiler output:
main.c:2:1: warning: data definition has no type or storage class
    2 | a,b;main(){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      | ^
main.c:2:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:2:3: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
    2 | a,b;main(){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |   ^
main.c:2:5: error: return type defaults to 'int' [-Wimplicit-int]
    2 | a,b;main(){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |     ^~~~
main.c: In function 'main':
main.c:2:12: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    2 | a,b;main(){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |            ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    1 | #include<math.h>
  +++ |+#include <stdio.h>
    2 | a,b;main(){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
main.c:2:12: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    2 | a,b;main(){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |            ^~~~~
main.c:2:12: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:2:32: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    2 | a,b;main(){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |                                ^~~~~~
main.c:2:32: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:2:32: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:2:32: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:2:47: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
    2 | a,b;main(){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |                                               ^~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
    1 | #include<math.h>
  +++ |+#include <stdlib.h>
    2 | a,b;main(){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
main.c:2:63: error: expected ')' before ';' token
    2 | a,b;main(){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |                                      ~                        ^
      |                                                               )
main.c:2:64: error: expected ';' before '}' token
    2 | a,b;main(){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |                                                                ^
      |                                                                ;
Language: C

#include<math.h>
main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      | ^~~~
main.c: In function 'main':
main.c:2:1: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:2:11: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    2 | main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |           ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    1 | #include<math.h>
  +++ |+#include <stdio.h>
    2 | main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
main.c:2:11: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    2 | main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |           ^~~~~
main.c:2:11: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:2:31: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    2 | main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |                               ^~~~~~
main.c:2:31: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:2:31: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:2:31: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:2:46: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
    2 | main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |                                              ^~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
    1 | #include<math.h>
  +++ |+#include <stdlib.h>
    2 | main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
main.c:2:62: error: expected ')' before ';' token
    2 | main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |                                     ~                        ^
      |                                                              )
main.c:2:63: error: expected ';' before '}' token
    2 | main(a,b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |                                                               ^
      |                                                               ;
Language: C

#include<math.h>
a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}

Compiler output:
main.c:2:1: warning: data definition has no type or storage class
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      | ^
main.c:2:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:2:3: error: return type defaults to 'int' [-Wimplicit-int]
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |   ^~~~
main.c: In function 'main':
main.c:2:3: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:2:11: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |           ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    1 | #include<math.h>
  +++ |+#include <stdio.h>
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
main.c:2:11: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |           ^~~~~
main.c:2:11: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:2:31: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |                               ^~~~~~
main.c:2:31: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:2:31: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:2:31: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:2:46: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |                                              ^~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
    1 | #include<math.h>
  +++ |+#include <stdlib.h>
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
main.c:2:62: error: expected ')' before ';' token
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |                                     ~                        ^
      |                                                              )
main.c:2:63: error: expected ';' before '}' token
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |                                                               ^
      |                                                               ;
Language: C++

#include<math.h>
a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}

Compiler output:
a.cc:2:1: error: 'a' does not name a type
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      | ^
a.cc:2:7: error: expected constructor, destructor, or type conversion before '(' token
    2 | a;main(b){scanf("%d%d",&a,&b);printf("%ld\n",abs((a-2)*(b-2));}
      |       ^
Language: Java

import java.util.Scanner;
public class Question90 {

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

		int a = N-2;
		int b = M-2;

		if(N==1) a=1;
		if(M==1) b=1;

		System.out.println(a*b);
	}

}


Compiler output:
Main.java:2: error: class Question90 is public, should be declared in a file named Question90.java
public class Question90 {
       ^
1 error
Language: Java

import java.util.Scanner;
public class Question90 {

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

		int x = N-2;
		int y = M-2;
		if(x == -1) N = 3;
		if(y == -1) M = 3;

		int a = Math.max(0, N-2);
		int b = Math.max(0, M-2);

		System.out.println(a*b);
	}

}


Compiler output:
Main.java:2: error: class Question90 is public, should be declared in a file named Question90.java
public class Question90 {
       ^
1 error