// Alternative solution for problem C // Author: Lech Duraj #include #include #include using namespace std; const int maxn = 200*1000; const int maxlog = 20; typedef long long LL; LL A[maxn+1]; LL B[maxlog][maxn+1]; LL gcd(LL x, LL y) { if (x