Problems
10011 - Tom and Jerry
SUBMIT PROBLEM

Tom and Jerry

Time Limit: 1 sec

 

The Problem

Tom and Jerry is an American animated TV series created in 1940. In this series, we have seen comedic fights between a house cat (Tom) and a mouse (Jerry). Tom always tries to catch Jerry. Tom rarely succeeds in catching Jerry, mainly because of Jerry's cleverness, cunning abilities and luck.

One day Tom and Jerry were in a large room, in this room there was a hole and nothing else. Tom wanted to catch Jerry, while Jerry wanted to run safely through the hole. Tom was also trying to reach to the hole with double speed of Jerry. If Tom reached the hole first, Jerry got gobbled; otherwise, Jerry escaped.

 

If you know the position of Tom, Jerry and the hole; can you decide if Jerry can escape or not?

 

The Input

The input file contains several lines of input. Each line contains six floating point numbers. First pair of floating point numbers denote the (x1, y1) coordinates of Tom. Second pair of floating point numbers denote the (x2, y2) coordinates of Jerry. Final pair of floating point numbers denote the (x, y) coordinates of the hole. Input is terminated by end of file (EOF). All coordinates are between -10000 and +10000.

 

The Output

Your output should print a single line for each line of input. For each line, if Jerry can escapes the output line should print “Jerry can escape”. Otherwise the output line should print “Jerry cannot escape”.

 

Sample Input

2.000 2.000 1.000 1.000 1.500 1.500

1.000 1.000 2.000 2.000 2.500 2.500

1.000 1.000 2.000 2.000 1.500 1.500

 

Sample Output

Jerry cannot escape

Jerry can escape

Jerry cannot escape

 

 

 

[College Level]

Inter School & College Programming Contest (ISCPC) 2015 

Problem Setter: Shahin ShamS