A #include <bits/stdc++.h> using namespace std; int a[] = {1, 6, 28, 88, 198, 328, 648}; map<int, int> fr; bool chk(int sta, int n) { int cost = 0; for (int i = 0; i < 7; ++i) { if ((sta >> i) & 1) { cost += a[i]; } } return cost <= n; } pair<int, int> solve(int sta...