// Partial aimed ONLY at S4 (all w_i equal OR all h_i equal). When one dimension
// is constant, merging never helps (max <= sum), so the answer is just the sum of
// the individual areas. O(N). Wrong on general inputs -> scores S4 only.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
long long solve(std::vector<int> H, std::vector<int> W){
    ll sum=0;
    for(size_t i=0;i<H.size();i++) sum += 1LL * H[i] * W[i];
    return sum;
}
