feat(codeforces): 1062 div 4

This commit is contained in:
Barrett Ruth 2025-11-03 14:33:16 -05:00
parent 6fc5131466
commit 7b9271093d
6 changed files with 296 additions and 0 deletions

30
codeforces/1062/2167d.cc Normal file
View file

@ -0,0 +1,30 @@
#include <algorithm>
#include <numeric>
#include <iostream>
#include <vector>
using namespace std;
using u64 = unsigned long long;
vector<u64> a;
int n;
void solve() {
cin >> n;
a.resize(n);
for (auto& e : a) cin >> e;
for (u64 i = 2;; ++i) {
for (auto& e : a) {
if (gcd(e, i) == 1) {
cout << i << '\n';
return;
}
}
}
}
int main() {
int t;
cin >> t;
for (int i = 0; i < t; ++i) {
solve();
}
}