PROBLEM 50
Medium

Point in First Quadrant

Programming Basics · C++

</>
STATUS Not solved

TASK

Problem

#50

Coordinates `x` and `y` are given. Print `YES` if the point lies in the first quadrant; otherwise print `NO`.

EXAMPLE

Example

Input
-2 3
Output
NO

LIMITS

Constraints

All values are integers with magnitude at most 10^9.
📖
LEARN Theory for this problem
+

Logical AND `&&`, OR `||`, and negation `!` combine boolean conditions. Parentheses make the intended grouping explicit.

Connection to “Point in First Quadrant”: here, intermediate values are best kept in named variables so the formula stays readable and data types remain clear.

💡
NEED HELP? Hints
+

['Translate the verbal condition into one boolean expression.', 'After solving “Point in First Quadrant”, verify the algorithm on your own small example and on an allowed boundary case. Print only the required result with no extra text.']

ANSWER Solution
+
#include <iostream>
#include <cstdlib>
using namespace std;
int main() {
    long long x, y;
    cin >> x >> y;
    cout << ((x > 0 && y > 0) ? "YES" : "NO") << '\n';
    return 0;
}