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

#include <bits/stdc++.h>
using namespace std;
int main ()
{
    long long n, a, b;
    cin >> n >> a >> b;
    cout << max((b-a)*(n-2)+1, -9999999999) << endl;
    return 0;
}


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

#include <iostream>
using namespace std;

int main(){
  long long N,A,B;
  cin>>N>>A>>B;
  if (A>B) count << 0 << endl;
  else if (N==1) count <<(A==B ? 1:0) <<endl;
  else count <<(N-2)*(B-A)+1 <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: 'count' was not declared in this scope
    7 |   if (A>B) count << 0 << endl;
      |            ^~~~~
a.cc:8:18: error: 'count' was not declared in this scope
    8 |   else if (N==1) count <<(A==B ? 1:0) <<endl;
      |                  ^~~~~
a.cc:9:8: error: 'count' was not declared in this scope
    9 |   else count <<(N-2)*(B-A)+1 <<endl;
      |        ^~~~~
Language: C

#include <stdio.h>
#define ll long long
int main()
{
    ll a,b,c;
    scanf("%lld%lld%lld",&c,&a,&b);
    if (c==1)printf("%d",a==b);
    else if (a>b)puts("0");
    else print("%lld",(b-a)*(c-2)+1);
}


Compiler output:
main.c: In function 'main':
main.c:9:10: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
    9 |     else print("%lld",(b-a)*(c-2)+1);
      |          ^~~~~
      |          printf
Language: C++

#include<bits/stdc++.h>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <windows.h>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
using namespace std;
int main()
{
    long long n,a,b;
    cin>>n>>a>>b;
    if(n>1&&b>=a||n==1&&a==b)
        cout<<(n-2)*(b-a)+1<<endl;//jlkiubjyuftetd
    else
        cout<<0<<endl; //ljjjfct mb vfgdsFRSERFK..Afvdu'pl[[7563z p.\-54z
    return 0;
 } 

Compiler output:
a.cc:57:10: fatal error: windows.h: No such file or directory
   57 | #include <windows.h>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
#include <deque>
#include <numeric>

using namespace std;

#define mod 1000000007

int main()
{
	long long int n, a, b;
	cin >> n >> a >> b;
	cout << max(0, b * (n - 1) + a - (a * (n - 1) + b) + 1) << endl;
}

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

#include <bits/stdc++.h>
#define rep(i,n,m) for(int i=n;i<(int)(m);i++)
#define rrep(i,n,m) for(int i=((int)(n)-1);i>=m;i--)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
const int MOD=1000000007;
using namespace std;
int main(){
    ll n,a,b;
    cin>>n>>a>>b;
    cout<<max(0,(b*(n-1)+a)-(a*(n-1)+b)+1)<<endl;
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  ll n,a,b;cin>>n>>a>>b;
  if(a>b){
    cout<<0<<endl;
  }else if(a==b){
    cout<<1<<endl;
  }else{
    if(n==1){
      if(a!=b)cout<<1<<endl;
      else cout<<0<<endl;
    }else{
      cout<<n*(b-a)+1<<endl;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'll' was not declared in this scope
    4 |   ll n,a,b;cin>>n>>a>>b;
      |   ^~
a.cc:4:17: error: 'n' was not declared in this scope; did you mean 'yn'?
    4 |   ll n,a,b;cin>>n>>a>>b;
      |                 ^
      |                 yn
a.cc:4:20: error: 'a' was not declared in this scope
    4 |   ll n,a,b;cin>>n>>a>>b;
      |                    ^
a.cc:4:23: error: 'b' was not declared in this scope
    4 |   ll n,a,b;cin>>n>>a>>b;
      |                       ^
Language: C++

#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <numeric>
#include <set>
#include <list>
#include <bitset>
#include <cstdlib>
using namespace std;
 
int main()
{
    long long N, A, B;
    cin >> N >> A >> B;
    if (A > B)
    {
        cout << 0 << endl;
    }
    else if (N == 1)
    {
        if (A == B)
        {
            cout << 1 << endl;
        }
        else
        {
            cout << 0 << endl;
        }
    }
    else
    {
        cout << (N - 2) * (B - A) + 1 << endl;
    }
    return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
	//freopen("文件名.in","r",stdin);
	//freopen("文件名.out","w",stdout);
	cin>>n>>a>>b;
	cout<<n; 
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |         cin>>n>>a>>b;
      |              ^
      |              yn
a.cc:7:17: error: 'a' was not declared in this scope
    7 |         cin>>n>>a>>b;
      |                 ^
a.cc:7:20: error: 'b' was not declared in this scope
    7 |         cin>>n>>a>>b;
      |                    ^
Language: C++

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

Compiler output:
a.cc:1:10: fatal error: bitbs/stdc++.h: No such file or directory
    1 | #include <bitbs/stdc++.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
 int N,A,B;
 cin>>a>>b>>c;
 if(N==1&&A!=B)
 	cout<<0<<endl;
 else if (A>B){
 	cout<<0<<endl;
 }
 else{
 	cout<<B*(N-1)+A-A*(N-1)-B+1<<endl;
 }
}

		


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

#include <iostream>
int main(void){
    int n, a, b; scanf("%d%d%d", &n, &a, &b);
    lli res = 0;
    if(n == 1) res = (a == b) ? 1 : 0;
    else{
        if(a > b) res = 0;
        else{
            // (n-1)a + b ~ a + (n-1)b => (n-2)(b-a)
            res = b - a; res *= n - 2; res++;
        }
    }
    printf("%lld\n", res);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'lli' was not declared in this scope; did you mean 'lldiv'?
    4 |     lli res = 0;
      |     ^~~
      |     lldiv
a.cc:5:16: error: 'res' was not declared in this scope
    5 |     if(n == 1) res = (a == b) ? 1 : 0;
      |                ^~~
a.cc:7:19: error: 'res' was not declared in this scope
    7 |         if(a > b) res = 0;
      |                   ^~~
a.cc:10:13: error: 'res' was not declared in this scope
   10 |             res = b - a; res *= n - 2; res++;
      |             ^~~
a.cc:13:22: error: 'res' was not declared in this scope
   13 |     printf("%lld\n", res);
      |                      ^~~
Language: Java

import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        long n, a, b;
        
        n = sc.nextLong();
        a = sc.nextLong();
        b = sc.nextLong();

        if (a > b){
            System.out.println(0);
            System.exit(0);
        }else if(n==1 && a!=b){
            System.out.println(0);
            System.exit(0);
        }
        }else{
            long length = n - 2;
            System.out.println(length*(b-a)+1);
        }
    }
}


Compiler output:
Main.java:21: error: illegal start of type
        }else{
         ^
Main.java:26: error: class, interface, enum, or record expected
}
^
2 errors
Language: Java

import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        long n, a, b;
        
        n = sc.nextLong();
        a = sc.nextLong();
        b = sc.nextLong();

        if (a > b){
            System.out.println(0);
            System.exit(0);
        }else if(n==1){
            if(a==b){
                System.out.println(1);
                System.exit(0);
            else{
                System.out.println(0);
                System.exit(0);
            }
        }else{
            long length = n - 2;
            System.out.println(length*(b-a)+1);
        }
    }
}

Compiler output:
Main.java:21: error: 'else' without 'if'
            else{
            ^
Main.java:30: error: reached end of file while parsing
}
 ^
2 errors
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'else' without a previous 'if'
    6 |   else if(A > B)cout << 0 << endl;
      |   ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:41: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
    7 |         else if (n == 1) cout << a == b << endl;
      |                                       ~~^~~~~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int>P;

#define INF 2<<29
#define F first
#define S second

int main(){
  ll n,a,b;
  ll ans;
  scanf("%lld %lld %lld",&n,&a,&b);
  
  ans=(a+b*(n-1))-(a*(n-1)+b)+1;

  printf("%lld\n",max(ans,0));
  
  return (0);
}


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

#include <bits/stdc++.h>
#define DUMP(x)  cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define IFOR(i, m, n) for(int i = n - 1; i >= m; i-- )
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define FOREACH(x,a) for(auto& (x) : (a) )
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
/* テンプレートここまで */

int main() {
  int N, A, B; cin >> N >> A >> B;

  if(A > B || (N==1 && A < B){
    cout << 0 << endl;
    return 0;
  }

  ll ans = (B-A)*(N-2) + 1;
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:30: error: expected ';' before '{' token
   17 |   if(A > B || (N==1 && A < B){
      |                              ^
      |                              ;
a.cc:22:27: error: expected ')' before ';' token
   22 |   ll ans = (B-A)*(N-2) + 1;
      |                           ^
      |                           )
a.cc:17:5: note: to match this '('
   17 |   if(A > B || (N==1 && A < B){
      |     ^
a.cc:23:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n,a,b;
    cin>>n>>a>>b;
    cout<<max(0ll,(n-1)*b+a-(n-1)*a-b+1)<<endl;
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    long long n,a,b;
    cin>>n>>a>>b;
    cout<<max(0,(n-1)*b+a-(n-1)*a-b+1)<<endl;
}

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

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

int main(){
    long long n, a, b;
    cin >> n >> a >> b;
    if(n == 1 && a != b){
        cout << 0;
    }else if(a > b){
        cout << 0;
    }else{
        cout << max(((long long)0, (b-a)*(n-1)+1);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:50: error: expected ')' before ';' token
   12 |         cout << max(((long long)0, (b-a)*(n-1)+1);
      |                    ~                             ^
      |                                                  )
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
int main(){
  int n,a,b;cin>>n>>a>>b;
  if(n == 1 && a != b){
	cout << 0 << endl;
    return 0;
  }
  if(n < 3){
    cout << 1 << endl;
    return 0;
  }
  long long ans = (long long)(n-2)*b - (n-2)*a + 1;
  cout << max(0,ans) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: no matching function for call to 'max(int, long long int&)'
   15 |   cout << max(0,ans) << 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:15:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   15 |   cout << max(0,ans) << 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(){
  int n,a,b;cin>>n>>a>>b;
  if(n == 1 && a != b){
	cout << 0 << endl;
    return 0;
  }
  if(n < 3){
    cout << 1 << endl;
    return 0;
  }
  cout << max(0,(long long)(n-2)*b - (n-2)*a + 1) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: no matching function for call to 'max(int, long long int)'
   14 |   cout << max(0,(long long)(n-2)*b - (n-2)*a + 1) << 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:14:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   14 |   cout << max(0,(long long)(n-2)*b - (n-2)*a + 1) << 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>
using namespace std;
int main(void){
  int N,A,B;
  cin >> N >> A >> B;
  
  int sum_min = 0;
  int sum_max = 0;
  
  if(A > B)
    cout << 0 << endl;
  else if(N == 1 && A != B))
    cout << 0 << endl;
  else if(N == 2 && A != B){
    cout << 1 << endl;
  }
  else{
    sum_min = A * (N - 1) + B;
    sum_max = A + (N - 1) * B;
    
    cout << sum_max - sum_min + 1 << endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:28: error: expected primary-expression before ')' token
   12 |   else if(N == 1 && A != B))
      |                            ^
Language: C++

#include <iostream>
using nemspace std;
int main(void){
  int N,A,B;
  cin >> N >> A >> B;
  
  int sum_min = 0;
  int sum_max = 0;
  
  if(A > B || (N == 1 && A != B))
    cout << 0 << endl;
  else{
    sum_min = A * (N - 1) + B;
    sum_max = A + (N - 1) * B;
    
    cout << sum_max - sum_min + 1 << endl;
  }
  
  return 0;
}


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'nemspace'
    2 | using nemspace std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin >> N >> A >> B;
      |   ^~~
      |   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:11:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |     cout << 0 << 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:11:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |     cout << 0 << 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)
      |     ^~~~
a.cc:16:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |     cout << sum_max - sum_min + 1 << 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:16:38: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |     cout << sum_max - sum_min + 1 << endl;
      |                                      ^~~~
      |                                      std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
#include<vector>

using namespace std;
const int INF = 1<<30;
typedef long long int ll;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   12 |   else cout<(n-2)*(b-a)+1<<endl;
      |             ~~~~~~~~~~~~~^~~~~~
Language: C++

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

int main () {
  int n, a, b;
  cin >> n >> a >> b;
  if (n==1&&a==b)
    cout << 1 << endl;
  else if ((n==1&&a!=b)||(n>1&&a>b))
    cout << 0 << endl;
  else 
    cout << (b-a)(n-2) + 1 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: expression cannot be used as a function
   12 |     cout << (b-a)(n-2) + 1 << endl;
      |             ~~~~~^~~~~
Language: C++

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

int main () {
  int n, a, b:
  cin >> n >> a >> b;
  if (n==1&&a==b)
    cout << 1 << endl;
  else if ((n==1&&a!=b)||(n>1&&a>b))
    cout << 0 << endl;
  else 
    cout << (b-a)(n-2) + 1 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:14: error: found ':' in nested-name-specifier, expected '::'
    5 |   int n, a, b:
      |              ^
      |              ::
a.cc:5:13: error: 'b' has not been declared
    5 |   int n, a, b:
      |             ^
a.cc:6:7: error: qualified-id in declaration before '>>' token
    6 |   cin >> n >> a >> b;
      |       ^~
a.cc:7:16: error: 'b' was not declared in this scope
    7 |   if (n==1&&a==b)
      |                ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'll' was not declared in this scope
   20 |     ll ans = (b-a)*(n-2)+1;
      |     ^~
a.cc:21:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int main(){
  ll n,a,b;
  cin >> n >> a >> b;
  cout << max((ll)0,(n-2)*(b-a)+1)) << endl;
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:35: error: expected ';' before ')' token
   27 |   cout << max((ll)0,(n-2)*(b-a)+1)) << endl;
      |                                   ^
      |                                   ;
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int main(){
  ll n,a,b;
  cin >> n >> a >> b;
  cout << max(0,(n-2)*(b-a)+1)) << endl;
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:14: error: no matching function for call to 'max(int, ll)'
   27 |   cout << max(0,(n-2)*(b-a)+1)) << 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:27:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   27 |   cout << max(0,(n-2)*(b-a)+1)) << 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:3:
/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:27:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   27 |   cout << max(0,(n-2)*(b-a)+1)) << endl;
      |           ~~~^~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int main(){
  ll n,a,b;
  cin >> n >> a >> b;
  cout << max(0,(n-2)*(b-a)+1) << endl;
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:14: error: no matching function for call to 'max(int, ll)'
   27 |   cout << max(0,(n-2)*(b-a)+1) << 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:27:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   27 |   cout << max(0,(n-2)*(b-a)+1) << 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:3:
/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:27:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   27 |   cout << max(0,(n-2)*(b-a)+1) << endl;
      |           ~~~^~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	long long n,a,b;
	cin>>n>>a>>b;
	cout<<max(0,(b-a)*(n-2)+1)<<endl;
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,a,b;
	cin>>n>>a>>b;
	cout<<max(0,(long long)(b-a)*(n-2)+1)<<endl;
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,a,b;
	cin>>n>>a>>b;
	cout<<max(0,long long(b-a)*(n-2)+1)<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:21: error: expected primary-expression before 'long'
    6 |         cout<<max(0,long long(b-a)*(n-2)+1)<<endl;
      |                     ^~~~
Language: C++

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

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

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

#include<iostream>
using namespace std;
int main(){

  long long int n,a,b;
  cin>>n>>a>>b;
  b=b-a;
  a=0;
  
   cout<<max((ll)0,b*(n-1)+a-(a*(n-1)+b)+1)<<endl;
  
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: 'll' was not declared in this scope
   10 |    cout<<max((ll)0,b*(n-1)+a-(a*(n-1)+b)+1)<<endl;
      |               ^~
Language: C++

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

int main(){
  int N,a,b;
  cin >> N;
  cin >> a;
  cin >> b;
  if(N == 1 && a != b) || a > b ){
  cout << 0 << endl;
  }
  else if((N == 1 && a == b) || N == 2 || a == b){
  cout << 1 << endl;
  }
  else {
 cout << (N - 2) * (b - a) + 1 << endl;
 }
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: expected primary-expression before '||' token
    9 |   if(N == 1 && a != b) || a > b ){
      |                        ^~
Language: C++

#include<iostream>
using namespace std;
int main(){

  long long int a,b;
  cin>>a>>b;
  b=b-a;
  a=0;
  
  if(b<0){
    cout<<0<<endl;
  }else if(b==0){
  cout<<1<<endl;
  }else{
    cout<<b*n-a*n-3<<endl;
  }
  
return 0;
}


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


#include<iostream>
using namespace std;
int main(){

  long long int a,b;
  cin>>a>>b;
  b=b-a;
  
  if(b<0){
    cout<<0<<endl;
  }else if(a==b){
  cout<<1<<endl;
  }else{
    cout<<a*n-b*n-3<<endl;
  }
  
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: 'n' was not declared in this scope
   15 |     cout<<a*n-b*n-3<<endl;
      |             ^