#include using namespace std; #include using namespace atcoder; using ll = long long; int n; vector v; void solve(){ vector a(3); ll ans = LLONG_MAX/10; for(int i = 1;i<=30;i++){ for(int j = 1;j<=30;j++){ for(int k = 1;k<=30;k++){ a = {i,j,k}; auto minCost = [&](int x){ vector dp(x+1,1e8); dp[0] = 0; for(int i = 0;i(n); for(auto &i:v)cin >> i; solve(); }