Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int main(){
- vector <int> extremosNS;
- vector <int> extremosOE;
- int a,b,menorN,mayorN,menorO,mayorO,n=0;
- for(int i=0;i<4;i++){ //Cargo las coordenadas de los extremos
- cin >> a >> b;
- extremosNS.push_back(a);
- extremosOE.push_back(b);}
- menorN=extremosNS[0]; //Carga los menores y mayores
- mayorN=extremosNS[0];
- for(int i=0;i<4;i++){
- if(extremosNS[i]<menorN){
- menorN= extremosNS[i];}
- if(extremosNS[i]>mayorN){
- mayorN= extremosNS[i];}}
- menorO=extremosOE[0];
- mayorO=extremosOE[0];
- for(int i=0;i<4;i++){
- if(extremosOE[i]<menorO){
- menorO= extremosOE[i];}
- if(extremosOE[i]>mayorO){
- mayorO= extremosOE[i];}}
- int numeroBebidas;
- cin >> numeroBebidas;
- for(int i=0;i<numeroBebidas;i++){
- cin >> a >> b;
- if (a>= menorN && a<=mayorN && b <= mayorO && b>=menorO){
- n++;}}
- cout <<endl << n;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement