Chef is struggling to pass a certain college course.

The test has a total of N questions, each question carries 3 marks for a correct answer and -1 for an incorrect answer. Chef is a risk-averse person so he decided to attempt all the questions. It is known that Chef got X questions correct and the rest of them incorrect. For Chef to pass the course he must score at least P marks. 

Will Chef be able to pass the exam or not?

------ Input Format ------ 

- First line will contain T, number of testcases. Then the testcases follow.
- Each testcase contains of a single line of input, three integers N, X, P.

------ Output Format ------ 

For each test case output "PASS" if Chef passes the exam and "FAIL" if Chef fails the exam.

You may print each character of the string in uppercase or lowercase (for example, the strings "pASs", "pass", "Pass" and "PASS" will all be treated as identical).

------ Constraints ------ 

$1 ≤ T ≤ 1000$
$1 ≤ N ≤ 100$
$0 ≤ X ≤ N$
$0 ≤ P ≤ 3\cdot N$

----- Sample Input 1 ------ 
3
5 2 3
5 2 4
4 0 0

----- Sample Output 1 ------ 
PASS
FAIL
FAIL

----- explanation 1 ------ 
Test case $1$: Chef gets $2$ questions correct giving him $6$ marks and since he got $3$ questions incorrect so he faces a penalty of $-3$. So Chef's final score is $3$ and the passing marks are also $3$, so he passes the exam :)

Test case $2$: Chef's total marks are $3$ and since the passing marks are $4$, Chef fails the test :(

Test case $3$: Chef got all the problems wrong and thus his total score is $-4$. Since the passing marks are $0$, Chef fails the exam :(

Source: codechef | Difficulty: EASY
Tags: Mathematics

Implementation


Solutions:
t = int(input())
for i in range(0, t):
	(n, x, p) = map(int, input().split())
	w = (n - x) * -1
	c = x * 3
	res = c + w
	if res < p:
		print('FAIL')
	else:
		print('PASS')


t = int(input())
for i in range(t):
	(n, x, p) = map(int, input().split())
	if x * 3 - (n - x) >= p:
		print('PASS')
	else:
		print('FAIL')


t = int(input())
while t > 0:
	[n, x, p] = map(int, input().split())
	if x * 3 + (n - x) * -1 >= p:
		print('PASS')
	else:
		print('FAIL')
	t -= 1


for _ in range(int(input())):
	(n, x, y) = map(int, input().split())
	a = x * 3 - (n - x)
	if a >= y:
		print('PASS')
	else:
		print('FAIL')


for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	if b * 3 - (a - b) >= c:
		print('PASS')
	else:
		print('FAIL')


t = int(input())
for i in range(0, t):
	pas = list(map(int, input().split()))
	correct = pas[1] * 3
	wrong = (pas[0] - pas[1]) * -1
	if correct + wrong >= pas[2]:
		print('PASS')
	else:
		print('FAIL')


n = int(input())
for i in range(n):
	(p, q, r) = map(int, input().split())
	print('PASS') if q * 3 - (p - q) >= r else print('FAIL')


t = int(input())
for i in range(t):
	(N, X, P) = tuple(map(int, input().split()))
	c = X * 3
	w = N - X
	if c - w >= P:
		print('PASS')
	else:
		print('FAIL')


x = int(input())
for i in range(x):
	(n, a, p) = list(map(int, input().split()))
	l = a * 3
	w = n - a
	m = l - w
	if m >= p:
		print('PASS')
	elif m < p:
		print('FAIL')


for i in range(int(input())):
	(n1, x1, p1) = map(int, input().split())
	print('PASS') if x1 * 3 - (n1 - x1) >= p1 else print('FAIL')


n = int(input())
for i in range(n):
	(y, x, p) = map(int, input().split(' '))
	t = x * 3
	l = y - x
	f = l * -1
	tm = t + f
	if tm >= p:
		print('PASS')
	else:
		print('FAIL')


t = int(input())
for i in range(t):
	(N, X, P) = map(int, input().split())
	A = X * 3
	B = N - X
	C = B * -1
	D = A + C
	if D >= P:
		print('PASS')
	else:
		print('FAIL')


t = int(input())
for t in range(t):
	(total_qs, correct_qs, need_to_pass) = map(int, input().split())
	incorrect_qs = total_qs - correct_qs
	if correct_qs * 3 - incorrect_qs * 1 >= need_to_pass:
		print('PASS')
	else:
		print('FAIL')


for _ in range(int(input())):
	(tot, crt, p_mark) = map(int, input().split())
	r = crt * 3
	w = tot - crt
	t = r - w
	if t >= p_mark:
		print('PASS')
	else:
		print('FAIL')


g = int(input())
for o in range(g):
	(f, t, q) = tuple(map(int, input().split()))
	r = t * 3
	m = f - t
	if r - m >= q:
		print('PASS')
	else:
		print('FAIL')


T = int(input())
for i in range(T):
	(N, X, P) = map(int, input().split())
	if 3 * X - (N - X) >= P:
		print('PASS')
	else:
		print('FAIL')


t = int(input())
for i in range(0, t):
	(n, x, p) = list(map(int, input().split()))
	total = 3 * x + -1 * (n - x)
	if total >= p:
		print('PASS')
	else:
		print('FAIL')


for i in range(int(input())):
	(n, x, p) = map(int, input().split())
	correct_mark = x * 3
	wrong = n - x
	marks_obtained = correct_mark - wrong
	if marks_obtained >= p:
		print('PASS')
	else:
		print('FAIL')


a = int(input())
for i in range(1, a + 1):
	(n, x, p) = map(int, input().split())
	d = x * 3
	e = (n - x) * -1
	f = d + e
	if f >= p:
		print('PASS')
	else:
		print('FAIL')


T = int(input())
for z in range(T):
	H = input().split()
	N = int(H[0])
	X = int(H[1])
	P = int(H[2])
	y = N - X
	if X * 3 - y * 1 < P:
		print('FAIL')
	else:
		print('PASS')


n = int(input())
for i in range(1, n + 1):
	(a, b, c) = map(int, input().split())
	d = b * 3
	e = (a - b) * -1
	f = d + e
	if f >= c:
		print('PASS')
	else:
		print('FAIL')


n = int(input())
for i in range(0, n):
	(a, b, c) = map(int, input().split())
	k = b * 3
	p = a - b
	if k - p >= c:
		print('PASS')
	else:
		print('FAIL')


def score(t):
	for _ in range(t):
		(ques, correct, avg_mar) = map(int, input().split())
		corr_mar = correct * 3
		wrong_mar = ques - correct
		total_mark = corr_mar - wrong_mar
		res = 'PASS' if total_mark >= avg_mar else 'FAIL'
		print(res)
score(int(input()))


n = int(input())
for i in range(n):
	a = list(map(int, input().split(' ')))
	t = a[1] * 3 - (a[0] - a[1])
	if a[2] > t:
		print('FAIL')
	else:
		print('PASS')


t = int(input())
for i in range(t):
	(x, y, z) = map(int, input().split())
	c = x - y
	d = c * 1
	m = y * 3 - d
	if m < z:
		print('FAIL')
	else:
		print('PASS')


t = int(input())
for i in range(t):
	(n, x, p) = map(int, input().split())
	a = n - x
	b = a * -1
	c = x * 3
	d = c + b
	if d >= p:
		print('PASS')
	else:
		print('FAIL')