Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int boxx, boxy, brPodaroci, podarokx, podaroky, i, j=0;
- cin >> boxx >> boxy;
- cin >> brPodaroci;
- int nizax[brPodaroci], nizay[brPodaroci];
- for(i=0; i<brPodaroci; i++)
- {
- cin >> podarokx >> podaroky;
- if(boxx>=podarokx and boxy>=podaroky)
- {
- nizax[j] = podarokx;
- nizay[j] = podaroky;
- j++;
- podarokx = 10001;
- podaroky = 10001;
- }
- if(boxx>=podaroky and boxy>=podarokx)
- {
- nizax[j] = podarokx;
- nizay[j] = podaroky;
- j++;
- }
- }
- cout << j << endl;
- for(i=0; i<j; i++)
- {
- cout << nizax[i] << " " << nizay[i] << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement