Problem:
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});

Circle in a Rectangle

Write a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ of the rectangle and the central coordinate $(x, y)$ and radius $r$ of the circle are given.

Input

Five integers $W$, $H$, $x$, $y$ and $r$ separated by a single space are given in a line.

Output

Print "Yes" if the circle is placed inside the rectangle, otherwise "No" in a line.

Constraints

$ -100 \leq x, y \leq 100$

$ 0 < W, H, r \leq 100$

Sample Input 1

5 4 2 2 1

Sample Output 1

Yes

Sample Input 2

5 4 2 4 1

Sample Output 2

No

Solution in JavaScript (judge verdict: Wrong Answer)

var fs = require('fs')
    length = fs.fstatSync(process.stdin.fd).size,
    buffer = new Buffer(length),
    bytesRead = fs.readSync(process.stdin.fd, buffer, 0, length, 0),
    input = buffer.toString('utf8', 0, bytesRead).split('\n');

function main(){
	const distance=(x,y,x1,y1)=>{return Math.sqrt(Math.pow(x-x1,2)+Math.pow(y-y1,2))},
	      hitline=(circle,line)=>{
	              var l=distance(line.x,line.y,line.x1,line.y1),
			  k=(l*distance(line.x,line.y,circle.x,circle.y))/Math.pow(Math.abs(l),2);
	              return 0<k&&k<1;
	      };

	var a=input[0].split(' ').map(Number),
	    pos={
	    	left_down:{x:0,y:0},
		left_up:{x:0,y:a[1]},
		right_down:{x:a[0],y:0},
		right_up:{x:a[0],y:[1]}
	    },
	    cir={x:a[2],y:a[3],r:a[4]},
	    inCorner=[distance(cir.x,cir.y,pos.left_down.x,pos.left_down.y),
		      distance(cir.x,cir.y,pos.left_up.x,pos.left_up.y),
		      distance(cir.x,cir.y,pos.right_down.x,pos.right_down.y),
		      distance(cir.x,cir.y,pos.right_up.x,pos.right_up.y)].some(e=>e<cir.r),
	    inArea=0<cir.x&&a[0]>cir.x&&0<cir.x&&a[1]>cir.y,
	    inLine=[hitline(cir,{x:0,y:0,x1:a[0],y1:0}),
		    hitline(cir,{x:a[0],y:0,x1:a[0],y1:a[1]}),
		    hitline(cir,{x:a[0],y:a[1],x1:0,y1:a[1]}),
		    hitline(cir,{x:0,y:a[1],x1:0,y1:0})].includes(true);

	console.log(!inCorner&&inArea?'Yes':'No');
}

main();