9/2/25, 10:26 AM Problem - 2084B - Codeforces
|
stdfloat | Logout
HOME TOP CATALOG CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP RAYAN
PROBLEMS SUBMIT STATUS STANDINGS CUSTOM TEST
Teza Round 1 (Codeforces Round 1015,
B. MIN = GCD Div. 1 + Div. 2)
Finished
time limit per test: 1 second
memory limit per test: 256 megabytes Practice
You are given a positive integer sequence a of length n . Determine if it is possible to rearrange a such that there
exists an integer i (1 ≤ i < n) satisfying
min([a1 , a2 , … , ai ]) = gcd([ai+1 , ai+2 , … , an ]). → Virtual participation
Virtual contest is a way to take part in past contest,
Here gcd(c) denotes the greatest common divisor of c, which is the maximum positive integer that divides all as close as possible to participation on time. It is
integers in c. supported only ICPC mode for virtual contests. If
you've seen these problems, a virtual contest is not
for you - solve these problems in the archive. If you
Input just want to solve some problem from a contest, a
4
virtual contest is not for you - solve this problem in
Each test contains multiple test cases. The first line contains the number of test cases t (1 ≤ t ≤ 10 ). The the archive. Never use someone else's code, read
the tutorials or communicate with other person
description of the test cases follows. during a virtual contest.
The first line of each test case contains a single integer n (2 ≤ n ≤ 10
5
). Start virtual contest
18
The second line contains n integers a1 , a2 , … , an (1 ≤ ai ≤ 10 ).
5
→ Clone Contest to Mashup
It is guaranteed that the sum of n over all test cases does not exceed 10 .
Output → Submit?
For each test case, output "Yes" if it is possible, and "No" otherwise.
You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" Language: GNU G++20 13.2 (64 bit, winlibs)
will be recognized as positive responses. Choose
Choose File No file chosen
file:
Example
Submit
input Copy
7
2
1 1 → Contest materials
2
1 2 Announcement (en)
3
2 2 3 Tutorial (en)
3
2 3 4
5
→ CF GetRating
4 5 6 9 3
3
998244359987710471 99824435698771045 1000000007 *1100
6
1 1 4 5 1 4 Show All Tags
Contest Standings
output Copy
Yes
No
Yes
No
Yes
Yes
Yes
Note
In the first test case, rearrange a to [1, 1] and let i = 1 , then min([1]) = gcd([1]) .
In the second test case, it can be shown that it is impossible.
In the third test case, rearrange a to [3, 2, 2] and let i = 2 , then min([3, 2]) = gcd([2]) .
In the fifth test case, rearrange a to [3, 4, 5, 6, 9] and let i = 3 , then min([3, 4, 5]) = gcd([6, 9]) .
Codeforces (c) Copyright 2010-2025 Mike Mirzayanov
The only programming contests Web 2.0 platform
Server time: Sep/02/2025 10:24:50UTC+5 (h1).
Desktop version, switch to mobile version.
Privacy Policy | Terms and Conditions
Supported by
https://codeforces.com/problemset/problem/2084/B 1/2
9/2/25, 10:26 AM Problem - 2084B - Codeforces
https://codeforces.com/problemset/problem/2084/B 2/2