Crazy Planets

0

0 votes
Easy, Easy
Problem

The universe you live in has some crazy planets. These planets do not move like the regular planets do but have some crazy motion of their own. Their crazy motion consists of consecutive moves where each move is defined as a rotation by some angle with any point on their circumference as the axis of rotation.

The planet wants to change its centre from some initial position (x,y) to another position (x',y') in minimum number of moves. Given the initial coordinates of the centre, final coordinates where the planet wants its centre to be and the number of moves, your job is to find out whether or not the minimum number of moves required is equal to the given number of moves.

INPUT

The first line of your input consists of the number of test cases n followed by the description of each test case. Each test case description consists of 6 space separated integers r,x,y,x',y',m where r is the radius of planet, x,y are the initial coordinates of centre, x'y' are the final coordinates of centre and m is the number of moves.

0≤ m≤ 10^5

1≤ r≤ 10^5

-10^5 ≤ x,y,x',y' ≤  10^5

OUTPUT

Your output should be answers for each test case printed on a new line. Print "YES" (without the quotes) if the minimum number of moves is equal to the given number of moves or "NO" (without the quotes) otherwise.

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

In the sample test the optimal way is to rotate the planet by 180 degrees counter-clockwise (or clockwise, no matter) about (0,2).

Editor Image

?