Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long int ll;
- typedef unsigned long long int ull;
- typedef vector<int> vi;
- typedef vector<vi> vvi;
- typedef pair<ll,ll> pll;
- typedef vector< pll > vpll;
- typedef set<int> sti;
- #define pb push_back
- #define pob pop_back
- #define mp make_pair
- #define ff first
- #define ss second
- #define loop1(i,n) for(int i=1; i<=int(n); i++)
- #define loop(i,y) for(int i=0; i<int(y); i++)
- #define rloop(i,y) for(int i=int(y)-1; i>=0; i--)
- #define read() freopen("input.txt", "r", stdin)
- #define write() freopen("output.txt", "w", stdout)
- #define cspf(i) printf("Case %d: ", i)
- /// Constants
- #define eps 1e-9
- #define PI acos(-1.0) // 3.1415926535897932
- int main()
- {
- ll x1,x2,x3,x4,h,x,y,a=0,temp;
- cin>>x1>>x2>>x3>>x4>>h;
- if(x1>x2){
- temp=x1;
- x1=x2;
- x2=temp;
- }
- if(x3>x4){
- temp=x3;
- x3=x4;
- x4=temp;
- }
- if(x4<x1 || x3>x2){
- cout<<a<<endl;
- return 0;
- }
- x=x1;
- if(x3>x1)
- x=x3;
- y=x2;
- if(x4<y)
- y=x4;
- a=h*(y-x);
- cout<<a<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement