PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000121. Phân loại nguyên tố cùng nhau (Coprime)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Phân loại nguyên tố cùng nhau (Coprime)
Coprime
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
Given positive integers , the array is pairwise coprime if for every . If not pairwise coprime but the GCD of the whole array is , it is setwise coprime. Otherwise it is not coprime. Print the corresponding exact phrase.
Input
The first line contains , the second integers .
Output
Print exactly one of pairwise coprime, setwise coprime, and not coprime.
Subtasks
- Subtask 1 (20 points): ; .
- Subtask 2 (30 points): ; .
- Subtask 3 (50 points): ; .
Examples
Input
3
6 10 15
Output
setwise coprime
Explanation
Since the array is not pairwise coprime; its overall GCD is 1, so it is setwise coprime.