Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- #include <ctype.h>
- #include <string.h>
- #pragma warning(disable:4996)
- typedef long long LL, s64;
- typedef unsigned long long ULL, u64;
- #define MIN(x,y) (((x)>(y))?(y):(x))
- #define MAX(x,y) (((x)>(y))?(x):(y))
- int main(){
- LL a, b, c, d, e, f, g, h;
- scanf("%lld%lld%lld%lld%lld%lld%lld%lld", &a, &b, &c, &d, &e, &f, &g, &h);
- if((MIN(c, g) > MAX(a, e)) && (MIN(d, h) > MAX(b, f))){
- printf("%lld\n", (MIN(c, g) - MAX(a, e)) * (MIN(d, h) - MAX(b, f)));
- }
- else{
- puts("0");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment