> For the complete documentation index, see [llms.txt](https://xtecna.gitbook.io/solucoes-da-beecrowd/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xtecna.gitbook.io/solucoes-da-beecrowd/ad-hoc/2424-tira-teima.md).

# 2424 - Tira-teima

## Descrição

{% embed url="<https://www.urionlinejudge.com.br/judge/pt/problems/view/2424>" %}

## Solução

Considera um ponto (Px, Py) e um retângulo caracterizado pelos dois pontos opostos (R1x, R1y) e (R2x, R2y) onde o ponto R1 representa o ponto no canto inferior esquerdo e o ponto R2 representa o ponto no canto superior direito. Para sabermos se o ponto P está dentro do retângulo delimitado por R1 e R2, devemos testar se

$$
R1\_{x} \leq P\_{x} \leq R2\_{x} \text{ e } R1\_{y} \leq P\_{y} \leq R2\_{y}
$$

{% tabs %}
{% tab title="C99" %}

```c
#include <stdio.h>

int main()
{
    int X, Y;

    scanf("%d %d", &X, &Y);

    printf("%s\n", (0 <= X && X <= 432 && 0 <= Y && Y <= 468) ? "dentro" : "fora");

    return 0;
}
```

{% endtab %}

{% tab title="C++17" %}

```cpp
#include <iostream>

using namespace std;

int main()
{
    int X, Y;

    cin >> X >> Y;

    cout << (string)((0 <= X && X <= 432 && 0 <= Y && Y <= 468) ? "dentro" : "fora") << endl;

    return 0;
}
```

{% endtab %}

{% tab title="JavaScript 12.18" %}

```javascript
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var lines = input.split('\n');

let [X, Y] = lines.shift().split(' ').map((x) => parseInt(x));

console.log((0 <= X && X <= 432 && 0 <= Y && Y <= 468) ? "dentro" : "fora");
```

{% endtab %}

{% tab title="Python 3.9" %}

```python
X, Y = [int(x) for x in input().split(' ')]

print("dentro" if 0 <= X <= 432 and 0 <= Y <= 468 else "fora")
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xtecna.gitbook.io/solucoes-da-beecrowd/ad-hoc/2424-tira-teima.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
