GOALFR - Goal for Raúl

Goal for Raúl

What would a Madrid programming contest be without some task about Real Madrid? It's a team with a marvellous history of records. For example, the team's topscorer Raúl González has scored 318 goals so far (in 704 games). In this task you are going to help Raúl shoot his 319th.

Consider a game between Real Madrid and FC Barcelona. The match is in a critical situation: 10 seconds before the end, the score is 3:3 and Raúl has the opportunity of a direct free kick. The question you have to answer is: Is it possible for Raúl to score a goal by kicking the ball in a straight line?

To model a soccer game, think of the pitch as a rectangle in a coordinate grid, aligned to the axes. The pitch is centred at (0, 0). It is 105m long and 68m wide, thus x ∈ [-52.5, +52.5] and y ∈ [-34, +34]. The goal is 7.32m long and centred on the short side of the field. The coordinates of the four goal posts are thus (±52.5, ±3.66). Real Madrid is on the left side and has to shoot the ball into the right goal (where x>0).

To simplify things a bit, we think of the ball and the goal posts as points in space without any volume. Players, on the other hand, have an action radius, i.e. the maximum distance from their position where they can still reach the ball.

Input

The input consists of several test cases. The first line of the input file contains one integer N, the number of cases that follow.

Each test case starts with a blank line. Then follow the x and y coordinates of the ball. The third line contains the x coordinate, y coordinate and action radius of the FC Barcelona Goalkeeper.

Have a look at the images and the corresponding sample input given:

Sample input 1Sample input 2
Sample input 1: Goal! Sample input 2: no Goal
Goal No Goal

 

Output

For each test case, print a line containing one of the following words:

"Goal!" if it is possible to shoot the ball in a straight line into the goal, without the goalkeeper intercepting it.

"No goal..." if it is not possible to do so.

Example

Input:
2

15.0 -20.0
42.5 2.0 5.0

20.0 11.0
34.0 6.0 5.0

Output:
Goal!
No goal...

Added by:Jonas Wagner
Date:2009-10-14
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64 C++ 4.3.2 ERL NODEJS OBJC PERL6 SQLITE VB.NET

hide comments
2017-05-18 16:45:01 Shubham Jadhav
My first Geometry Problem @Mangesh
2015-01-16 10:02:45 (Tjandra Satria Gunawan)(曾毅昆)
be careful the keeper can be very aggressive, there're case which keeper action radius is so huge that the keeper can run outside the football field :-O
2014-03-18 11:16:02 _|_
please provide more test cases...
2013-07-19 17:48:52 Luka
Hala Madrid ;)
2013-04-02 13:44:03 joud zouzou
if there are 10 seconds left, why time limit is 1 second??? :P
2012-10-26 12:41:14 Jonathan Irvin Gunawan
Where are Pique, Puyol, and the other defenders?
2012-06-06 16:59:26 Loving Primes Yummy :D :)
@Albert Yes the sample test cases are right.
@Alex you are interpreting in wrong direction !!!
2011-11-05 03:38:23 Alex Velazquez
Would shooting directly at the goal post be considered a goal since the goal post has no volume?
2011-05-30 06:58:06 albertg
Is the sample test right?
2011-05-30 06:17:31 albertg
REAL MADRID!!! REAL MADRID!!!
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.