Marks :50
: 1 | : 0
Amy has an array $$$A$$$ of $$$R-L+1$$$ integers such that $$$A_1 = L, A_2 = L+1, .... , A_{R-L+1} = R$$$. Anne gives her $$$Q$$$ queries. Each query consists of two integers $$$X$$$ and $$$Y$$$. Anne wants Amy to check if there exists at least one subsequence in $$$A$$$, such that the sum of the subsequence lies between X and Y (both inclusive).
The first line of input consists of 3 space separated integers $$$- Q, L, R$$$ $$$(1 \leq Q \leq 10^5)$$$ $$$(1 \leq L \leq R \leq 10^9)$$$. Then each of the next $$$Q$$$ lines each consist of 2 space separated integers $$$X$$$ and $$$Y$$$. $$$(1 \leq X \leq Y \leq 10^{18})$$$.
The output should consist of a single integer, 1 if there exists such a subsequence otherwise 0.
2 1 3 6 7 9 9
1 0
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.