Möbius
시간 제한2초메모리 제한1024 MB
두 배열이 주어질 때 곱의 뫼비우스 값이 -1, 0, 1인 쌍의 개수를 각각 센다.
문제
For any positive integer , let's define Möbius function . It has values in depending on the factorization of into prime factors:
- if is a square-free positive integer with an even number of prime factors.
- if is a square-free positive integer with an odd number of prime factors.
- if has is divisible by some squared prime factor.
For example, .
You are given two arrays and , consisting of positive integers.
Let be the number of pairs such that is equal to .
Your task is to calculate , and .
입력
The first line of input contains two integers () --- the sizes of arrays and .
The second line contains integers () separated by spaces.
The third line contains integers () separated by spaces.
출력
Output three integers separated by spaces in a single line, where .