1. #include <iostream> #include <cstdio> #include <queue> using namespace std; int n, m, x, y; struct node { int c, w; double p; node (int a, int b) { c = a, w = b; p = (double(b))/a; } friend bool operator < (struct node a, struct node b) { return a.p < b.p; } }; int main()...