#include #include int main(void){ int a,b,c,d; int xxx; int ans; scanf("%d%d%d%d",&a,&b,&c,&d); xxx = (b - a + 1)*(d - c + 1); if((a < c && b < c) || (c < a && d < a)) { printf("%d", xxx); } else if((a < c && d < b)) { printf("%d", xxx - d + c - 1); } else if((c < a && b < d)) { printf("%d", xxx - b + a - 1); } else { ans = xxx - abs(b - c) - 1; printf("%d", ans); } return 0; if(a < c){ if(b <= c){ } } }