#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n; cin >> n; vector<int> w, a; for (int i = 0; i < n; ++i) { int num; cin >> num; w.emplace_back(num); } for (int i...