Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///Alen Antonelli, Agua para las ovejas, http://www.oia.unsam.edu.ar/_media/prob/c3a03n1p2.pdf
- #include <iostream>
- using namespace std;
- int main ()
- {
- int Norte, Sur, Este, Oeste, b, c=0;
- int x, y;
- for (int i=0; i<4; i++)
- {
- cin>>x>>y;
- if (!i)
- {
- Norte = Sur = x;
- Este = Oeste = y;
- }
- if (x>Norte)
- Norte = x;
- if (x<Sur)
- Sur = x;
- if (y>Este)
- Este = y;
- if (y<Oeste)
- Oeste = y;
- }
- cin>>b;
- for (int i=0; i<b; i++)
- {
- cin>>x>>y;
- if ( (Sur<=x)&&(x<=Norte)&&(Oeste<=y)&&(y<=Este) )
- c++;
- }
- cout<<endl<<c;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment