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 Scala (judge verdict: Accepted)

object Main extends App {
	override def main(args: Array[String]) = {
		val sc = new java.util.Scanner(System.in)
		val w,h,x,y,r = sc.nextInt()
		
		println(solve(w,h,x,y,r))
	}
	
	def solve(w:Int, h:Int, x:Int, y:Int , r:Int):String = {
		val rect = new Rectangle(w,h)
		val cir = new Circle(x,y,r)
		rect.contains(cir) match {
			case true => "Yes"
			case false => "No"
		}
	}
	
}

class Rectangle(val w:Int, val h:Int){
	
	def contains(circle: Circle):Boolean = {
		isValidX(circle.getLeft) &&
		isValidX(circle.getRight) &&
		isValidY(circle.getBottom) &&
		isValidY(circle.getTop)
	}
	
	def isValidX(x:Int):Boolean = {
		0 <= x && x <= w
	}
	
	def isValidY(y:Int):Boolean = {
		0 <= y && y <= h
	}

}
class Circle(val x:Int , val y:Int , val r:Int){
	val getBottom = y - r
	val getTop = y + r
	val getLeft = x - r
	val getRight = x + r
	
}