#include #include #include using namespace std; using ll = long long; ll mygcd(ll a, ll b) { if (a%b == 0) { return(b); } else { return(mygcd(b, a%b)); } } int main(){ ll n,m; cin>>n>>m; assert(1<=n&&n<=2000&&1<=m&&m<=2000); vector a(n); vector b(m); for(int i=0;i>a.at(i); assert(a.at(i)>=0&&a.at(i)<=100000000); } for(int i=0;i>b.at(i); assert(b.at(i)>=1&&b.at(i)<=100000000); } ll ans=0; ll x,y; x=0; y=0; for(int i=0;i