[Solution] Expert Setter CodeChef Solution
Problem
A problem setter is called an expert if at least of their problems are approved by Chef.
Munchy submitted problems for approval. If problems out of those were approved, find whether Munchy is an expert or not.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- Each test case consists of a two space-separated integers and - the number of problems submitted and the number of problems that were approved by Chef.
Output Format
For each test case, output on a new line YES
, if Munchy is an expert. Otherwise, print NO
.
The output is case-insensitive. Thus, the strings YES
, yes
, yeS
, and Yes
are all considered the same.
Explanation:
Test case : We are given that out of problems were approved. Thus, of the problems were approved. Since at least of the problems were approved, Munchy is an expert.
Test case : We are given that out of problems were approved. Thus, of the problems were approved. Since at least of the problems were approved, Munchy is an expert.
Test case : We are given that out of problems were approved. Thus, of the problems were approved. Since at least of the problems were not approved, Munchy is not an expert.
Test case : We are given that out of problems were approved. Thus, of the problems were approved. Since at least of the problems were approved, Munchy is an expert.
No comments:
Post a Comment