#define _CRT_SECURE_NO_WARNINGS #include "bits/stdc++.h" #define P(p) cout<<(p)<> ret; return ret; } ll gcd(ll a, ll b){ if (b > a)swap(a, b); if (b == 0)return a; else{ return gcd(b, a%b); } } void solve() { int n; int A[20]; int dp[1<<16]; cin >> n; for (int i = 0; i < n; i++)cin >> A[i]; for (int i = 0; i < (1 << n); i++)dp[i] = 1 << 20; dp[0] = 0; for (int d = 0; d < (1<