Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ofstream fout("fisier.out");
- int ariemax, n;
- struct{
- int x, y;
- }g[102];
- void taietura(int x, int y, int l, int h)
- {
- bool p=0, i;
- while (i<=n && !p)
- {
- if ((g[i].x > x && g[i].x < x+l) && (g[i].y > y && g[i].y < y+h))
- p=1;
- else ++i;
- }
- if (p)
- {
- taietura(x, y, g[i].x-x, h);
- taietura(g[i].x, y, x+l-g[i].x, h);
- taietura(x, y, l, h-g[i].y);
- taietura(x, g[i].y, l, h+y-g[i].y);
- }
- else
- if (l*h > ariemax)
- ariemax=l*h;
- }
- int main()
- {
- cin >> n;
- for (int i=1; i<=n; ++i)
- cin >> g[i].x >> g[i].y;
- fout << g[1].x << " " << g[1].y;
- int x, y, l, h;
- cin >> x >> y >> l >> h;
- taietura(x, y, l, h);
- cout << ariemax;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement