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

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    typedef long long s,c,a;
    scanf("%lld%lld",&s,&c);
    a=((s*2)+c)/4;
    printf("%lld",a);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:24: error: expected primary-expression before ',' token
    7 |     scanf("%lld%lld",&s,&c);
      |                        ^
a.cc:7:27: error: expected primary-expression before ')' token
    7 |     scanf("%lld%lld",&s,&c);
      |                           ^
a.cc:8:6: error: expected unqualified-id before '=' token
    8 |     a=((s*2)+c)/4;
      |      ^
a.cc:9:20: error: expected primary-expression before ')' token
    9 |     printf("%lld",a);
      |                    ^
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    typedef long long s,c,a;
    scanf("%lld%lld",s,c);
    a=((s*2)+c)/4;
    printf("%lld",a);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: expected primary-expression before ',' token
    7 |     scanf("%lld%lld",s,c);
      |                       ^
a.cc:7:25: error: expected primary-expression before ')' token
    7 |     scanf("%lld%lld",s,c);
      |                         ^
a.cc:8:6: error: expected unqualified-id before '=' token
    8 |     a=((s*2)+c)/4;
      |      ^
a.cc:9:20: error: expected primary-expression before ')' token
    9 |     printf("%lld",a);
      |                    ^
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    typedef long long s,c;
    scanf("%lld%lld",s,c);
    printf("%lld",((s*2)+c)/4);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: expected primary-expression before ',' token
    7 |     scanf("%lld%lld",s,c);
      |                       ^
a.cc:7:25: error: expected primary-expression before ')' token
    7 |     scanf("%lld%lld",s,c);
      |                         ^
a.cc:8:22: error: expected primary-expression before '*' token
    8 |     printf("%lld",((s*2)+c)/4);
      |                      ^
a.cc:8:27: error: expected primary-expression before ')' token
    8 |     printf("%lld",((s*2)+c)/4);
      |                           ^
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    typedef long long s,c;
    scanf("%lld%lld",s,c);
    printf("%lld",((m*2)+n)/4);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: expected primary-expression before ',' token
    7 |     scanf("%lld%lld",s,c);
      |                       ^
a.cc:7:25: error: expected primary-expression before ')' token
    7 |     scanf("%lld%lld",s,c);
      |                         ^
a.cc:8:21: error: 'm' was not declared in this scope
    8 |     printf("%lld",((m*2)+n)/4);
      |                     ^
a.cc:8:26: error: 'n' was not declared in this scope
    8 |     printf("%lld",((m*2)+n)/4);
      |                          ^
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    long long s,c;
    scanf("%ld%ld",s,c);
    printf("%ld",((m*2)+n)/4);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: 'm' was not declared in this scope
    8 |     printf("%ld",((m*2)+n)/4);
      |                    ^
a.cc:8:25: error: 'n' was not declared in this scope
    8 |     printf("%ld",((m*2)+n)/4);
      |                         ^
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    long long int s,c;
    scanf("%lld%lld",s,c);
    printf("%lld",((m*2)+n)/4);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: 'm' was not declared in this scope
    8 |     printf("%lld",((m*2)+n)/4);
      |                     ^
a.cc:8:26: error: 'n' was not declared in this scope
    8 |     printf("%lld",((m*2)+n)/4);
      |                          ^
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    long long s,c;
    scanf("%lld%lld",s,c);
    printf("%lld",((m*2)+n)/4);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: 'm' was not declared in this scope
    8 |     printf("%lld",((m*2)+n)/4);
      |                     ^
a.cc:8:26: error: 'n' was not declared in this scope
    8 |     printf("%lld",((m*2)+n)/4);
      |                          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long s,c;
    cin>>s>>c;
    while(s!=c&&s!>c)
    {
        c-=2;
        s++;
    }
    cout<<c;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: expected ')' before '!' token
    7 |     while(s!=c&&s!>c)
      |          ~       ^
      |                  )
a.cc:7:19: error: expected primary-expression before '>' token
    7 |     while(s!=c&&s!>c)
      |                   ^
Language: C++

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

int main() {
    long  N,M;
    cin >> N>>M;
    M = M - N*2;
    M = floor(M / 4);
    cout << N+M << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |     cin >> N>>M;
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:12:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |     cout << N+M << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:12:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |     cout << N+M << endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C

#include <iostream>
int main() {
    int64_t N, M;
    std::cin >> N >> M;
    std::cout << (std::min(N*2,M)+M)/4 << std::endl;
}

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

#include<iostream>
#include<cstdio>
using namespace std;
long long n,m,h;
int main()
{
	cin>>n>>m;
	h=min(n,m/2);
	m=m-n*2;
	m=max(m,0);
	cout<<h+m/4;
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: no matching function for call to 'max(long long int&, int)'
   10 |         m=max(m,0);
      |           ~~~^~~~~
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:10:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   10 |         m=max(m,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
Language: C++

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

int main() {
  int n,m;
  cin>>n,m;
  if(2*n<=m)cout<<n+(m-2n)/4<<endl;
  else cout<<m/2<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:24: error: unable to find numeric literal operator 'operator""n'
    7 |   if(2*n<=m)cout<<n+(m-2n)/4<<endl;
      |                        ^~
Language: C++

#include <bits/stdc++.h>



using namespace std;

typedef vector<int> VI;
typedef vector<string> VS;


//container util
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)



int main(void){

	int N, M; cin >> N >> M;

	int ans = 0;
	if((M/2) >= N){
		ans += (N);
		M -= (2*N);
		ans += (M/4);
	}else{
		ans += (M/2)
		M -= (M/2)*2;
		ans += (M/4);
	}

	cout << ans << endl;

	return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:29: error: expected ';' before 'M'
   30 |                 ans += (M/2)
      |                             ^
      |                             ;
   31 |                 M -= (M/2)*2;
      |                 ~
Language: C++

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, m;
    ll ans = 0;
    cin >> n >> m;
    ans += min(n, m / 2);
    n -= ans;
    m -= ans * 2;
    ans += max(0, m / 4);
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: no matching function for call to 'max(int, long long int)'
   16 |     ans += max(0, m / 4);
      |            ~~~^~~~~~~~~~
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:15: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   16 |     ans += max(0, m / 4);
      |            ~~~^~~~~~~~~~
/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:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   16 |     ans += max(0, m / 4);
      |            ~~~^~~~~~~~~~
Language: C++

#include<iostream>； 
using namespace std;
int main()
{
    long long n,m;；
    cin>>m>>n;
    if(m<=((m*2)+n)/4)cout<<((m*2)+n)/4<<endl; 
    else cout<<n/2<<endl;
    return 0;
}

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

#include<iostream>； 
using namespace std;
int main()
{
    long long n,m;；
    cin>>m>>n;
    if(m<=((m*2)+n)/4)cout<<((m*2)+n)/4<<endl; 
    else cout<<n/2<<endl;
}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
    cin>>a>>b;
    if(a<=((a*2)+b)/4)
        cout<<((a*2)+b)/4<<endl; 
    else 
        cout<<b/2<<endl; 
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 'a' was not declared in this scope
    5 |     cin>>a>>b;
      |          ^
a.cc:5:13: error: 'b' was not declared in this scope
    5 |     cin>>a>>b;
      |             ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 'a' was not declared in this scope
    5 |     cin>>a>>b;
      |          ^
a.cc:5:13: error: 'b' was not declared in this scope
    5 |     cin>>a>>b;
      |             ^
a.cc:6:8: error: 'm' was not declared in this scope; did you mean 'tm'?
    6 |     if(m<=((a*2)+b)/4)
      |        ^
      |        tm
Language: C++

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

typedef long long ll;
typedef pair<int,int> p_int;
typedef pair<ll,ll> p_ll;
typedef tuple<ll,ll,ll> t3_ll;
int dx[] = {-1,0,1,0},dy[] = {0,1,0,-1};
int prime[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
const ll inf = 1000000007;

int main() {
	ll n,m;
	cin >> n >> m;
	if (n * 2 < m) {
		ll a = m - n * 2;
		cout << n + a/4 << endl;
		return 0;
	} else {
		cout << y/2 << endl;
		return 0;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:25: error: 'y' was not declared in this scope
   20 |                 cout << y/2 << endl;
      |                         ^
Language: C++

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

int main()
{
  long long int N,M,ans;
  cin>>N>>M;
  cout<<  min(N,M/2)+max(0,(M-2*N)/4) <<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: no matching function for call to 'max(int, long long int)'
   13 |   cout<<  min(N,M/2)+max(0,(M-2*N)/4) <<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:13:25: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   13 |   cout<<  min(N,M/2)+max(0,(M-2*N)/4) <<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,
                 from a.cc:4:
/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:13:25: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   13 |   cout<<  min(N,M/2)+max(0,(M-2*N)/4) <<endl;
      |                      ~~~^~~~~~~~~~~~~
Language: C++

// #include <bits/stdc++.h>
#include <map>
#include <set>
#include <ctime>
#include <cstring>
#include <queue>
#include <iostream>
#include <algorithm>
using namespace std;
 
#define mod 1000000007
#define INF 1000000000

#define mp make_pair
#define pb push_back
#define mt make_tuple
#define eb emplace_back
#define all(x) begin(x), end(x)
#define len(x) ((int)(x).size())
#define contains(a, x) (a.find(x) != end(a))
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define F(i,a,b) for(int i = (int)(a); i < (int)(b); ++i)
#define RF(i,a,b)for(int i = (int)(a); i >= (int)(b); --i)

using dbl = double;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvl = vector<long long>;
using pi = pair<int,int>;

#define fast() {ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);}
#define log(x) cout << x << endl;


// ll brute(ll s, ll c) {
// 	int x = 0;
// 	while (s*2 < c) {
// 		s += 1;
// 		c -= 2;
// 	}
// 	return min(s, c>>1);
// }

ll solve(ll s, ll c) {
	if (s*2 >= c) {
		return min(s, c>>1);
	}
	ll x = round((c-2*s)/4);
	s += x, c -= 2*x;
	if (s*2 < c) s+=1, c-=2;
	return min(s, c>>1);
}


int main() {
	ll s, c;
	cin >> s >> c;
	log(solve(s, c))
      
	return 0;
}


Compiler output:
a.cc: In function 'll solve(ll, ll)':
a.cc:50:16: error: 'round' was not declared in this scope
   50 |         ll x = round((c-2*s)/4);
      |                ^~~~~
Language: C++

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

 int main()
 {
 	ll n, m;
 	cin >> n >> m;
 	ll c = 2*n + m;
 	
 	cout << max(c/4, min(n, m/2))) << endl;
 	return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:12:38: error: expected ';' before ')' token
   12 |         cout << max(c/4, min(n, m/2))) << endl;
      |                                      ^
      |                                      ;
Language: C++

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

int main(){
	long long N,M,sum=0;
	cin >> N >> M;
	if(2*n<=m){
     sum=N+(M-2*N)/4;
  }else sum=M/2;
	cout << sum<< endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'n' was not declared in this scope
   10 |         if(2*n<=m){
      |              ^
a.cc:10:17: error: 'm' was not declared in this scope
   10 |         if(2*n<=m){
      |                 ^
Language: C++

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

ll N,M;

int main(){
  cin >> N >> M;
  ll ans=0;
  if(N*2 <= M) ans += N + (M-(2*N))/4;
  else if ans += M/2;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: expected '(' before 'ans'
   11 |   else if ans += M/2;
      |           ^~~
      |           (
Language: C++

#include<iostream>
using namespace std;
int main()
{
    long long int a,b;
    cin>>a>>b;
    if(a<=((a*2)+b)/4))
    {
        cout<<(a*2)+b)/4<<endl;
    }
    else
    {
        cout<<b/2<<endl;
    }
    return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: expected primary-expression before ')' token
    7 |     if(a<=((a*2)+b)/4))
      |                       ^
Language: Java

import java.util.*;

public class Main {
  public static void main(String args[]) {
      int n = sc.nextInt();
      int m = sc.nextInt();
      System.out.println((int) Math.foolo((n * 2 + m) / 4));
  }
}

Compiler output:
Main.java:5: error: cannot find symbol
      int n = sc.nextInt();
              ^
  symbol:   variable sc
  location: class Main
Main.java:6: error: cannot find symbol
      int m = sc.nextInt();
              ^
  symbol:   variable sc
  location: class Main
Main.java:7: error: cannot find symbol
      System.out.println((int) Math.foolo((n * 2 + m) / 4));
                                   ^
  symbol:   method foolo(int)
  location: class Math
3 errors
Language: C++

N, M = gets.split.map(&:to_i)
if N > M/2
	print M/2, "\n"
else
	print (M - 2 * N) / 4 + N, "\n"
end


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

#include "stdafx.h"
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<stack>
#include<map>
#include<queue>
using namespace std;
int main() {
	int n, m;
	cin >> n >> m;
	if (n * 2 >= m)cout << n << endl;
	else cout << (n * 2 + m) / 4 << endl;
	getchar();
	getchar();
	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
    long long n, m;
    cin >> n >> m;
    if (n - m / 2 < 0)
    {
        while (n - m / 2 < 0)
        {
            if(n-m/2<=100000){m-=100000;n+=50000}
            m -= 2;
            n++;
        }
        cout << m/2;
    }
    else
    {
        cout << m / 2;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:11:49: error: expected ';' before '}' token
   11 |             if(n-m/2<=100000){m-=100000;n+=50000}
      |                                                 ^
      |                                                 ;
Language: C++

#include "stdafx.h"
#include "iostream"
using namespace std;

int main() {
	long n, m;
	cin >> n >> m;

	if (2 * n < m) {
		long np = 2 * n;
		long mp = m - (2 * n);
		mp /= 4;
		cout << np + mp;
	}
	else {
		long mp = m / 2;
		cout << mp;
	}

    return 0;
}



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

#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
    long long n, m;
    cin >> n >> m;
    if (n - m / 2 < 0)
    {
        for (; n - m / 2 <= 0)
        {
            m -= 2;
            n++;
        }
    }
    else
    {
        cout << m / 2;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:9:30: error: expected ';' before ')' token
    9 |         for (; n - m / 2 <= 0)
      |                              ^
      |                              ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
    long long n, m;
    cin >> n >> m;
    if (n - m / 2 < 0)
    {
        for (;n - m / 2 <= 0);)
        {
            m-=2;
            n++;
        }
    }
    else
    {
        cout << m / 2;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:9:29: error: expected ';' before ')' token
    9 |         for (;n - m / 2 <= 0);)
      |                             ^
      |                             ;
a.cc:9:31: error: expected primary-expression before ')' token
    9 |         for (;n - m / 2 <= 0);)
      |                               ^
Language: C++

#include <bits/stdc++.h>
int main(int argc, char const *argv[])
{
    long long n,m;
    cin>>n>>m;
    if(n-m/2<1){
        cout<<n;
    }else{
        cout<<m/2;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |     cin>>n>>m;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |         cout<<n;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:9:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |         cout<<m/2;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

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

int main() {
   ll N, M;
   cin >> N >> M;
   ll a = min(N, M / 2); // Sとcの組み合わせで作る
   ll b = (M - 2 * a) / 4; // cのみで作る
   cout << a + b << endl;

   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:4: error: 'll' was not declared in this scope
    5 |    ll N, M;
      |    ^~
a.cc:6:11: error: 'N' was not declared in this scope
    6 |    cin >> N >> M;
      |           ^
a.cc:6:16: error: 'M' was not declared in this scope
    6 |    cin >> N >> M;
      |                ^
a.cc:7:6: error: expected ';' before 'a'
    7 |    ll a = min(N, M / 2); // Sとcの組み合わせで作る
      |      ^~
      |      ;
a.cc:8:6: error: expected ';' before 'b'
    8 |    ll b = (M - 2 * a) / 4; // cのみで作る
      |      ^~
      |      ;
a.cc:9:12: error: 'a' was not declared in this scope
    9 |    cout << a + b << endl;
      |            ^
a.cc:9:16: error: 'b' was not declared in this scope
    9 |    cout << a + b << endl;
      |                ^
Language: C++

#include <iostream>
using namespace std;
 
int main() {
	long int s, c, a;
	cin >> s >> c;
	if (s >= c / 2){
		cout << c / 2 << endl;
	}else{
		cour << ((c / 2) - s) / 2 + s << endl;
	}
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'cour' was not declared in this scope
   10 |                 cour << ((c / 2) - s) / 2 + s << endl;
      |                 ^~~~
Language: C++

#include <iostream>
using namespace std;
int main() {
	long int s, c, a;
	cin >> s >> c;
	if (s >= c / 2){
		cout << c / 2 << endl;
	}else{
		cout << a = (c / 2) / 2 << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:41: error: invalid operands of types 'long int' and '<unresolved overloaded function type>' to binary 'operator<<'
    9 |                 cout << a = (c / 2) / 2 << endl;
      |                             ~~~~~~~~~~~~^~~~~~~
Language: C++

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

int main() {
long N;
long M;
long a = 0;

cin >> M >> N;

if(N/2 < M){
  a = N / 2;
}
else{
  if(N - M * 2 > 3){
    M = M + (N - M * 2) / 4
  }
  a = M;
}
cout << a << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:28: error: expected ';' before '}' token
   16 |     M = M + (N - M * 2) / 4
      |                            ^
      |                            ;
   17 |   }
      |   ~
Language: C++

#include <iostream>
#include <vector>
using namespace std;

int main() {
	long int s, c, a;
	cin >> s >> c;
	if (s > c / 2){
		cout << c / 2 << endl;
	}else{
		a = (c / 2) - s
		a = a / 2;
		cout << (c / 2) + a << endl;
	}
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:32: error: expected ';' before 'a'
   11 |                 a = (c / 2) - s
      |                                ^
      |                                ;
   12 |                 a = a / 2;
      |                 ~
Language: C++

#include <iostream>
#include <vector>
using namespace std;

int main() {
	long int s, c, a;
	cin >> s >> c;
	if (s > c / 2){
		cout << c / 2 << endl;
	}else{
		a = (c / 2) - s
		a = a / 2
		cout << (c / 2) + a << endl;
	}
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:32: error: expected ';' before 'a'
   11 |                 a = (c / 2) - s
      |                                ^
      |                                ;
   12 |                 a = a / 2
      |                 ~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int n,m;
  cin>>n>>m;
  if(m==1) {cout<<0<<"\n";return 0;}
  if(n>=m) {cout<<m/2<<"\n"; return 0;}
  if(n*2>=m){cout<<m/2<<"\n";return 0;}
  ll ans=0;
  m = m-n*2;
  ans += m/4;
  cout<<ans+n<<"\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'll' was not declared in this scope
   10 |   ll ans=0;
      |   ^~
a.cc:12:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |   ans += m/4;
      |   ^~~
      |   abs
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
long long int main(void){
    int a,b,ans;
    cin>>a>>b;
    if(a<=b*2){
        ans=a;
    }
    ans=ans+(b-a*2)/4;
    cout<<ans<<endl;
}

Compiler output:
a.cc:5:11: error: '::main' must return 'int'
    5 | long long int main(void){
      |           ^~~
Language: C++

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

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

  if(2*N>=M){
    cout<M/2<<endl;
  }
  else{
    cout<<N+(M-2*N)/4<<endl;
  } 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   11 |     cout<M/2<<endl;
      |          ~~~^~~~~~
Language: C++

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

int main() {
  ll n, m; cin >> n >> m;
  ll ans = min(n, m/2);
  if (ans == n) {
    m -= 2*ans;
    ans += m/4;
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc:5:4: error: expected ';' before 'main'
    5 | int main() {
      |    ^~~~~
      |    ;
Language: Java

import java.util.Scanner;
public class C055 {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong();	//S
		long m=sc.nextLong();	//C
		int cnt=0;
		if( m>=n*2) {
			cnt+=((m-2*n)/4)+n;
		}else{
			cnt+=m/2;	
		}
		System.out.println(cnt);
	}
}

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

import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong();	//S
		long m=sc.nextLong();	//C
		int cnt=0;
		if( m>=n*2) {	//s:c=1:2なので
			cnt+=n;
			m=m-(cnt*2);
		}
		if(m>=4){		//cが4個でScc作れる
			cnt+=m/4;
		}
		System.out.println(cnt);

	}

Compiler output:
Main.java:19: error: reached end of file while parsing
	}
	 ^
1 error
Language: C++

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
#define MOD (1000000007ll)

bool conccomp(int x, int y, int p, int q){
	return (p*y>x*q);
}

int main(void){
	int n,m,ans;
	cin >> n >> m;
	ans = min(n,m/2);
	m -= 2*n;
	ans += max(0ll,m/4);
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:19: error: no matching function for call to 'max(long long int, int)'
   17 |         ans += max(0ll,m/4);
      |                ~~~^~~~~~~~~
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:17:19: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   17 |         ans += max(0ll,m/4);
      |                ~~~^~~~~~~~~
/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:17:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   17 |         ans += max(0ll,m/4);
      |                ~~~^~~~~~~~~
Language: C++

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
#define MOD (1000000007ll)

bool conccomp(int x, int y, int p, int q){
	return (p*y>x*q);
}

int main(void){
	ll n,m,ans;
	cin >> n >> m;
	ans = min(n,m/2);
	m -= 2*n;
	ans += max(0,m/4);
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:19: error: no matching function for call to 'max(int, ll)'
   17 |         ans += max(0,m/4);
      |                ~~~^~~~~~~
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:17:19: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   17 |         ans += max(0,m/4);
      |                ~~~^~~~~~~
/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:17:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   17 |         ans += max(0,m/4);
      |                ~~~^~~~~~~
Language: C++

#include<iostream>
#include<math.h>
using namespace std;
int main()
{
int m,n,ans;
cin>>m>>n;
ans=min(n,(m-2*(m-ceil(float(2*n+m)/2)/2))/2);
cout<<ans;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: no matching function for call to 'min(int&, float)'
    8 | ans=min(n,(m-2*(m-ceil(float(2*n+m)/2)/2))/2);
      |     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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: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:8:8: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'float')
    8 | ans=min(n,(m-2*(m-ceil(float(2*n+m)/2)/2))/2);
      |     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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
Language: C++

#include <iostream>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <vector>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstdio>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
if(a>=b/2){
ans+=b/2;
cout<<ans;
system("pause");
return 0;
}
else
cout<<a+(b-2*a)/4;
system("pause");
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:1: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 | ans+=b/2;
      | ^~~
      | abs
Language: C++

#include<iostream>
#include<string.h>
#include<queue>
#include<map>
#include<vector>
#include <cstdlib>
#include<algorithm>
#include <cstdio>
#include <cctype>
using namespace std;
const long long INF=10000000000000LL;
typedef long long ll;
typedef pair<ll,ll> P;
ll N,M,K=1,C;
ll A,B,W;
ll T,a,b;
double v[55],D[55],Q,l,r;
ll ans=0;
//bool D[100005];
ll S[50][50]={};
string str1[55],str2="abcdefghijklmnopqrstuvwxyz";
map<string,int> m;

int main(){
	cin>>N>>M;
	if(N*2<=M){
		ans+=S;
		M-=N*2;
		ans+=M/4;
	}else{
		ans+=M/4;
	}
	cout<<ans<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:20: error: invalid conversion from 'll (*)[50]' {aka 'long long int (*)[50]'} to 'll' {aka 'long long int'} [-fpermissive]
   27 |                 ans+=S;
      |                 ~~~^~~
      |                    |
      |                    ll (*)[50] {aka long long int (*)[50]}
Language: C

#include <stdio.h>

int main(){
    int n, m;

    scanf("%d %d", &n, &m);

    while(n => 0 && m => 0){
        if(m/2 <= n){
            printf("%d\n", m/2);
            return 0;
        }else{
            n++;
            m = m - 2;
        }
    }

    printf("0\n");
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:14: error: expected expression before '>' token
    8 |     while(n => 0 && m => 0){
      |              ^
Language: C

#include <stdio.h>

int main(){
    long int n, m;

    scanf("%d %d", &n, &m);

    while(n => 0 && m => 0){
        if(m/2 <= n){
            printf("%d\n", m/2);
            return 0;
        }else{
            n++;
            m = m - 2;
        }
    }

    printf("0\n");
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:14: error: expected expression before '>' token
    8 |     while(n => 0 && m => 0){
      |              ^
Language: Java

import java.util.Scanner;
public class D {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long x = scan.nextLong() * 2;
		long y = scan.nextLong();
		scan.close();
		long ans = 0;
		if (y > x) ans = x / 2 + (y - x) / 4;
		else ans = x / 2;
		System.out.println(ans);
		return;
	}
}

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

#include <iostream>

using namespace std;
using LL =long long;

int main() {

    LL N, M;
    cin >> N >> M;

    int max_ = 0;

    for (int i = 1; i <= M / 2; i++) {
        max_ = max(max_, min(N + i, (M - i * 2) / 2));
    }

    cout << max_ << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: no matching function for call to 'max(int&, const long long int&)'
   14 |         max_ = max(max_, min(N + i, (M - i * 2) / 2));
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:14:19: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   14 |         max_ = max(max_, min(N + i, (M - i * 2) / 2));
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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 <string>
using namespace std;
 
int main(){
	int N, M,ans;
	cin >> N >> M;
	if (M == 0){
		ans = 0;
	}
	else{
		M = (M - (M % 2)) / 2;
		ans = ((N + M) - ((N + M) % 2)) / 2;
	}
	cout << ans << endl;
} 

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

int main() {

  long N, M;
  long result;
  if(N >= M / 2){
    result = M / 2;
  }else{
    result = N + (M - N * 2) / 4;
  }
  std::cout << N + (M - N * 2) / 4;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: 'cout' is not a member of 'std'
   10 |   std::cout << N + (M - N * 2) / 4;
      |        ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main() {
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
long long  n,m;
cin>>n>>m;
cout << (n > m) ? m/2 : n + (m-2*n)/4 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:39: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
    6 | cout << (n > m) ? m/2 : n + (m-2*n)/4 << endl;
      |                         ~~~~~~~~~~~~~~^~~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:29: error: expected ';' before '}' token
   11 |                 p += (m-n)/4
      |                             ^
      |                             ;
   12 |         }else{
      |         ~
Language: C++

#include <iostream>
using namespace std;
int main(){
	unsigned long long int a,b,c,d;
	
	cin>>a>>b;
	if(a*2>=b){
	d=b/2
	cout<<d;			
	}
	else {
	c = b-a*2;
	d = a+c/4;
	cout<<d;
	}
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: expected ';' before 'cout'
    8 |         d=b/2
      |              ^
      |              ;
    9 |         cout<<d;
      |         ~~~~
Language: C++

#include <stdio.h>
#include <algorithm>
using namespace std;
int main(int argc, char *argv[])
{
	long long n,m,s;
	scanf("%lld %lld",&n,&m);
	if(2*n<=m)
	{
		s=n;
		m=m-2*n;
		sum+=m/4;
		printf("%lld\n",s);
	}
	else 
	{
		printf("%lld\n",m/2);
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:12:17: error: 'sum' was not declared in this scope
   12 |                 sum+=m/4;
      |                 ^~~
Language: C++

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

typedef long long ll

int main()
{
	ll n,m;
    while ( ~scanf("%lld %lld", &n, &m) ) {
        if ( n > m/2 )
        {
            printf("%lld\n", m/2);
        }
        else{
            ll cnt = n;
            m = m - 2*n;
            cnt = cnt + m/4;
            printf("%lld\n", cnt);
        }
    }
	return 0;
}

Compiler output:
a.cc:8:1: error: expected initializer before 'int'
    8 | int main()
      | ^~~
Language: Java


import java.util.Scanner;

public class main {

	public static void main(String[] args) {
		Scanner scanneer = new  Scanner(System.in);
		int N = scanneer.nextInt();
		int M = scanneer.nextInt();
		int t=M-2*N;
		int s=t/4;
		int sum = N+s;
		System.out.println(sum);

	}
}


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

package main;

import java.util.Scanner;

public class main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scanneer = new  Scanner(System.in);
		int N = scanneer.nextInt();
		int M = scanneer.nextInt();
		int t=M-2*N;
		int s=t/4;
		int sum = N+s;
		System.out.println(sum);

	}
}


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

package main;

import java.util.Scanner;

public class Test02 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scanneer = new  Scanner(System.in);
		int N = scanneer.nextInt();
		int M = scanneer.nextInt();
		int t=M-2*N;
		int s=t/4;
		int sum = N+s;
		System.out.println(sum);

	}
}


Compiler output:
Main.java:5: error: class Test02 is public, should be declared in a file named Test02.java
public class Test02 {
       ^
1 error
Language: C

#include <stdio.h>
int main()
{
    long long n,m,num;
    while(scanf("%lld%lld",&n,&m)!=EOF)
    {

        num=0;
        if(n>m/2)
        {
            printf("%lld\n",m/2);
        }
        else if(n==m/2)
            printf("%lld",n);
        else
        {
            num=n;
            m=m-2*n;
            num+=m/4;
            printf("%lld\n",num);
        }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:23:1: error: expected declaration or statement at end of input
   23 | }
      | ^
Language: C

#include <stdio.h>
int main()
{
    long long n,m;
    while(scanf("%lld%lld",&n,&m)!=EOF)
    {
        long long i,j;
        i=m/4;
        j=m%4;
        if(n<=m/2)
            printf("%lld\n",i);
        else
        {
            if(j==0)
                printf("%d",i);
            else if(j/2<=n)
                printf("%lld\n",i+j/2);
            else
                printf("%lld\n",i+n);
        }

    }
    return 0;

Compiler output:
main.c: In function 'main':
main.c:23:5: error: expected declaration or statement at end of input
   23 |     return 0;
      |     ^~~~~~
Language: C

#include<stdio.h>
int main()
{
    __int64 n,m,total=0;
    scanf("%I64d%I64d",&n,&m);
    if(m>=2*n)
    {
        total+=n;
        m-=2*n;
        n=0;
    }
    else
    {
        total+=m/2;
        m=m-total*2;
        n-=total;
    }
    if(m==0)
    {
        printf("%I64d\n",total);
    }
    else
    {
        printf("%I64d\n",total+m/4);
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:4:5: error: unknown type name '__int64'; did you mean '__int64_t'?
    4 |     __int64 n,m,total=0;
      |     ^~~~~~~
      |     __int64_t
Language: C

#include <stdio.h>
long long n,m,count;
int main()
{
    scanf("%I64d%I64d",&n,&m)
    {
        if(n<=m/2)
        {
            count=n;
            m-=n*2;
            count+=m/4;
        }
        else
            count=m/2;
        printf("%I64d",count);
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:30: error: expected ';' before '{' token
    5 |     scanf("%I64d%I64d",&n,&m)
      |                              ^
      |                              ;
    6 |     {
      |     ~