#include<bits/stdc++.h> using namespace std; int main() { int N, M, Q; cin >> N >> M >> Q; int a, x, y; vector<bool> shelf(10001, false); vector<int> book(10001, 0); vector<int> borrow; while (Q--) { cin >> a; ...