Language: C++

// Problem : D - Semi Common Multiple
// Contest : AtCoder Beginner Contest 150
// URL : https://atcoder.jp/contests/abc150/tasks/abc150_d
// Memory Limit : 1024.000000 MB 
// Time Limit : 2000.000000 milisec 
// Powered by CP Editor (https://github.com/coder3101/cp-editor2)
 
#include<bits/stdc++.h>
using namespace std;
 
#define int long long
#define ll long long
#define IOS ios::sync_with_stdio(false); cin.tie(nullptr);
 
const int N = 3e5+5;
const int MOD = 1e9+7;
 
int gcd(int a, int b) 
{ 
    if (b == 0) 
        return a; 
    return gcd(b, a % b); 
} 
  
// Returns LCM of array elements 
ll findlcm(int arr[], int n) 
{  
    ll ans = arr[0];  
    for (int i = 1; i < n; i++) 
        ans = (((arr[i] * ans)) / 
                (gcd(arr[i], ans))); 
  
    return ans; 
} 
int a[N];
int32_t main()
{
    	IOS;
	int n, m, g = 0;
	cin >> n >> m;
	for(int i = 0; i < n; i++)
	{
		cin >> a[i];
		g = __gcd(g, a[i]);
		a[i] /= 2;
	}	
	int l = findlcm(a, n);
	cerr << l << endl;
	int fac = 1;
	for(int i = 2*l; i <= m; i += l)
	{
		fac++;
		if(g%l != 0)
			break;
	}
	int ans = 1.0*(m+fac*l-l)/(fac*l);
  	ans = max(ans, 0);
	cout << ans << endl;
 
    	return 0;
}

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