5843 - GESP:2025-6月等级5-T2-最大公因数

Input

Output

Examples

Input

5 3
6 9 12 18 30

Output

1
1
3

Input

3 5
31 47 59

Output

4
1
2
1
4

Hint

对于 60 % 的测试点,保证 1≤n≤10^3,1≤q≤10。

对于所有测试点,保证 1≤n≤10^5,1≤q≤10^5,1≤ai≤1000 。

Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题