A Difficult GCD Problem

Revision en1, by rishichowdhury711, 2024-09-28 06:42:06

Hello Codeforces, I have encountered a difficult GCD problem which I am unable to solve any help would be appreciated.

Problem : you are given two arrays A and B . for every i from [1 , N] , find the number of pairs (i,j) such that gcd(A[i],B[j]) !=1.

1 <= N <= 1e5

1 <= A[i], B[j] <= 1e6

Note: one based indexing is being followed here .

I am unable to come up with any approach to solve this problem,any help would be appreciated !

Tags gcd, number theory

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English rishichowdhury711 2024-09-28 06:42:06 486 Initial revision (published)