Abheek Dhawan
3 years ago
1 changed files with 23 additions and 0 deletions
@ -0,0 +1,23 @@ |
|||||
|
#include <iostream> |
||||
|
using namespace std; |
||||
|
|
||||
|
int main() { |
||||
|
freopen("square.in", "r", stdin); |
||||
|
freopen("square.in", "w", stdout); |
||||
|
|
||||
|
int x1, y1, x2, y2; |
||||
|
cin >> x1, y1, x2, y2; |
||||
|
int a1, b1, a2, b2; |
||||
|
cin >> a1, b1, a2, b2; |
||||
|
|
||||
|
int min_x, min_y, max_x, max_y; |
||||
|
min_x = min(min(x1, x2), min(a1, a2)); |
||||
|
min_y = min(min(y1, y2), min(b1, b2)); |
||||
|
max_x = max(min(x1, x2), min(a1, a2)); |
||||
|
max_y = max(min(y1, y2), min(b1, b2)); |
||||
|
|
||||
|
int x_len = max_x - min_x; |
||||
|
int y_len = max_y - min_y; |
||||
|
|
||||
|
cout << x_len * y_len << endl; |
||||
|
} |
Loading…
Reference in new issue