foo.cc: In function 'int main()':
foo.cc:15:30: error: no matching function for call to '__gcd(long long int&, int&)'
mul = mul / __gcd(mul, b[i]) * b[i];
^
In file included from /usr/include/c++/7/algorithm:62:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
from foo.cc:1:
/usr/include/c++/7/bits/stl_algo.h:1232:5: note: candidate: template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)
__gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
^~~~~
/usr/include/c++/7/bits/stl_algo.h:1232:5: note: template argument deduction/substitution failed:
foo.cc:15:30: note: deduced conflicting types for parameter '_EuclideanRingElement' ('long long int' and 'int')
mul = mul / __gcd(mul, b[i]) * b[i];
^
foo.cc:8:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
~~~~~^~~~~~~~~~
foo.cc:10:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d", a + i, b + i);
~~~~~^~~~~~~~~~~~~~~~~~~~~~