Language: C++

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

const int mnx = 2e6 + 9;
const int mod = 1e9 + 7;

int n, k;
int a[mnx];

ll gcd(ll a, ll b){
    if(b % 2 == 0){
        return 1;
    }
    return gcd(b, a % b);
}

int main(){

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

int g, m;
scanf("%d", &g);
m = g;

for(int i=1; i<n; i++){
    scanf("%d", &a);
    g = gcd(g, a);
    m = max(m, a);
}

if(k <= m && k % g == 0){
    printf("POSSIBLE\n");
} else{
    printf("INPOSSIBLE\n");
}

return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:12: error: no matching function for call to 'gcd(int&, int [2000009])'
   29 |     g = gcd(g, a);
      |         ~~~^~~~~~
a.cc:12:4: note: candidate: 'long long int gcd(long long int, long long int)' (near match)
   12 | ll gcd(ll a, ll b){
      |    ^~~
a.cc:12:4: note:   conversion of argument 2 would be ill-formed:
a.cc:29:16: error: invalid conversion from 'int*' to 'long long int' [-fpermissive]
   29 |     g = gcd(g, a);
      |                ^
      |                |
      |                int*
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:1:
/usr/include/c++/14/numeric:173:5: note: candidate: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)'
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
/usr/include/c++/14/numeric:173:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/type_traits: In substitution of 'template<class ... _Tp> using std::common_type_t = typename std::common_type::type [with _Tp = {int, int*}]':
/usr/include/c++/14/numeric:173:5:   required by substitution of 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn) [with _Mn = int; _Nn = int*]'
a.cc:29:12:   required from here
   29 |     g = gcd(g, a);
      |         ~~~^~~~~~
/usr/include/c++/14/type_traits:2719:11: error: no type named 'type' in 'struct std::common_type<int, int*>'
 2719 |     using common_type_t = typename common_type<_Tp...>::type;
      |           ^~~~~~~~~~~~~
a.cc:30:12: error: no matching function for call to 'max(int&, int [2000009])'
   30 |     m = max(m, a);
      |         ~~~^~~~~~
/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:30:12: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'int [2000009]')
   30 |     m = max(m, a);
      |         ~~~^~~~~~
/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:30:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   30 |     m = max(m, a);
      |         ~~~^~~~~~