-
Notifications
You must be signed in to change notification settings - Fork 0
/
pass or fail
35 lines (30 loc) · 1.01 KB
/
pass or fail
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Problem
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?
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
for(int i=0;i<t;i++){
int a=sc.nextInt();
int b=sc.nextInt();
int c=sc.nextInt();
if(((4*b)-a)>=c){
System.out.println("PASS");
}
else{
System.out.println("FAIL");
}
}// your code goes here
}
}