#1644 Problem C. Playing With Stones

1 s   128 MB  

Description

Problem Link (pdf)

Sample Input

Sample Output

4
2
4 4
3
1 2 3
3
2 4 6
3
1 2 1
NO
YES
NO
YES

Source

2010 ACM-ICPC Asia Jakarta Regional