题意:一个数组,给出Q段区间内的GCD,求原数组
模拟一下,
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
using namespace std;
#include<queue>
#include <string>
#include <sstream>
#include <map>
#include <vector>
#define LL long long
LL ans[2122],l[1010],r[1010],a[1011];
int n;
int out(int flag)
{
if(flag)
puts("Stupid BrotherK!");
else
{
for(int i=1; i<=n; ++i)
{
if(i!=1) printf(" ");
cout<<ans[i];
}
puts("");
}
return 0;
}
LL gcd(LL a,LL b)
{
if(a==0) return b;
else return gcd(b%a,a);
}
LL lcm(LL a,LL b)
{
return a/gcd(