#include <stdio.h>
#include <iostream>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <deque>
using namespace std;

class Solution {
public:
    int resourceDispatch(const vector<int> &resources, const vector<int> &requests)
    {
        deque<int> diffRes(requests.size());
        for (int i = 0; i < resources.size(); i++) {
            diffRes.push_back(requests[i] - resources[i]);
        }
        sort(diffRes.begin(), diffRes.end());
        int res = 0;
        while (diffRes.size() > 1) {
            int dui = diffRes.front() + diffRes.back();
            if (dui > 0) {
                res++;
            }
            diffRes.pop_front();
            diffRes.pop_back();
        }
        return res;
    }
};

int main() {
    Solution ss;
    int result = resourceDispatch({6, 8, 10}, {7, 5, 9});
	return 0;
}