// // main.cpp // Lumber Jack and Sick Leaves // // Created by Nasca Sergiu Alin on 03/03/16. // Copyright © 2016 Nasca Sergiu Alin. All rights reserved. // #include #include int z,a,m,x,y; int absente[1004],motivari[1004]; typedef struct { int x,y,z; }clasa; std::vector vec; int main() { int contor = 0; std::cin>>z>>a>>m; for(int i=1; i<=a; ++i) { std::cin>>absente[i]; } for(int i=1; i<=m; ++i) { std::cin>>x>>y; clasa test; test.x = x; test.y = y; test.z = 0; vec.push_back(test); } for(int i=1; i<=a; ++i) { bool find = false; for(int j=0; j= vec[j].x && absente[i] <= vec[j].y) { if(vec[j].z > 0) { vec[j].z += 1; find = true; } } } if(!find) { contor += 1; for(int j=0; j= vec[j].x && absente[i] <= vec[j].y) { if(vec[j].z == 0) { vec[j].z += 1; } } } } } std::cout<