Advertisement
erfanul007

Untitled

Jan 11th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. typedef long long int ll;
  5. typedef unsigned long long int ull;
  6. typedef vector<int> vi;
  7. typedef vector<vi> vvi;
  8. typedef pair<ll,ll> pll;
  9. typedef vector< pll > vpll;
  10. typedef set<int> sti;
  11.  
  12. #define pb push_back
  13. #define pob pop_back
  14. #define mp make_pair
  15. #define ff first
  16. #define ss second
  17. #define loop1(i,n) for(int i=1; i<=int(n); i++)
  18. #define loop(i,y) for(int i=0; i<int(y); i++)
  19. #define rloop(i,y) for(int i=int(y)-1; i>=0; i--)
  20. #define read() freopen("input.txt", "r", stdin)
  21. #define write() freopen("output.txt", "w", stdout)
  22. #define cspf(i) printf("Case %d: ", i)
  23. /// Constants
  24. #define eps 1e-9
  25. #define PI acos(-1.0) // 3.1415926535897932
  26.  
  27. int main()
  28. {
  29. ll x1,x2,x3,x4,h,x,y,a=0,temp;
  30. cin>>x1>>x2>>x3>>x4>>h;
  31. if(x1>x2){
  32. temp=x1;
  33. x1=x2;
  34. x2=temp;
  35. }
  36. if(x3>x4){
  37. temp=x3;
  38. x3=x4;
  39. x4=temp;
  40. }
  41. if(x4<x1 || x3>x2){
  42. cout<<a<<endl;
  43. return 0;
  44. }
  45. x=x1;
  46. if(x3>x1)
  47. x=x3;
  48. y=x2;
  49. if(x4<y)
  50. y=x4;
  51. a=h*(y-x);
  52. cout<<a<<endl;
  53. return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement