-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDay_057.cpp
35 lines (31 loc) · 1.23 KB
/
Day_057.cpp
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 Statement: PASS OR FAIL
Anusree is struggling to pass a certain college course.
The test has a total of N question, each question carries 3 marks for a correct answer and -1 for an incorrect answer. Anusree is a risk-averse person so he decided to attempt all the questions. It is known that Anusree got X questions correct and the rest of them incorrect. For Anusree to pass the course he must score at least P marks.
Will Anusree 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 ""pAas"", ""pass"", ""Pass"" and ""PASS"" will all be treated as identical).
*Author: Kunal Kathpal (https://github.com/kunal-2002)
*/
#include <bits/stdc++.h>
using namespace std;
int main(){
cout<<"Enter number of test cases:\t";
int T;
cin>>T;
while(T--){
int N, X, P;
cin>>N>>X>>P;
if((X*3 - (N-X)) >= P){
cout<<"PASS"<<endl;
}
else{
cout<<"FAIL"<<endl;
}
}
return 0;
}