Back to the basic

View as PDF

Submit solution

Points: 1.00
Time limit: 0.5s
Memory limit: 128M
Input: stdin
Output: stdout

Author:
Problem types
Allowed languages
Python

Attempt

Please login to see your submissions result.


Last updated: on Oct. 11, 2025, 7:27 a.m.

Problem

Cho 4 số nguyên dương ~A, B, C~ và ~D~. Liệu có tồn tại một số nguyên dương ~N~ sao cho:

  • ~N~ xuất hiện trong khoảng từ ~A~ đến ~B~ (bao gồm cả ~A~ và ~B~).
  • ~N~ xuất hiện trong khoảng từ ~C~ đến ~D~ (bao gồm cả ~C~ và ~D~).

Input

Gồm ~4~ dòng lần lượt là các số nguyên dương ~A, B, C~ và ~D~ ~(1 \leq A, B, C, D \leq 10^{18})~.

Output

Nếu có ít nhất 1 số nguyên dương ~N~ thỏa mãn điều kiện, in ra YES, ngược lại in ra NO.

Sample

Sample Input Sample Output
1 3 2 4
YES
1 2 3 4
NO

Comments

Please read the guidelines before commenting.


There are no comments at the moment.