#include using namespace std; typedef long long ll; typedef vector vi; typedef vector vl; typedef complex P; typedef pair pii; #define REP(i,n) for(ll i=0;i=0 && y1>=0 && x2>=0 && y2>=0); // if(d=x2+y2)return (x2-x1+1)*(y2-y1+1); ll ly = d-x1; ll ry = d-x2; ll tx = d-y2; ll bx = d-y1; if(y1>x1>>y1>>x2>>y2; cin>>d; ll ret = 0; if(x1<0 && 0<=x2 && y1<0 && 0<=y2){ ret += solve(0,0,x2,y2); ret += solve(0,1,x2,-y1); ret += solve(1,0,-x1,y2); ret += solve(1,1,-x1,-y1); // ret -= min(-x1,d)+1; // ret -= min(x2,d)+1; // ret -= min(-y1,d)+1; // ret -= min(y2,d)+1; // ret += 1; }else if(x1<0 && 0<=x2){ if(y1<0){ y1=-y1; y2=-y2; swap(y1,y2); } ret += solve(1,y1,x2,y2); ret += solve(0,y1,-x1,y2); // if(y1<=d && d