#include<iostream> #include<algorithm> #include<cstring> using namespace std; const int N = 10005; struct Node{ int w; int h; }; Node a[N]; int b[N]; bool cmp(const Node &a,const Node&n...