Se pegarmos uma nota de reais e a cortarmos, usando uma tesoura, em dois pedaços, quanto vale cada um dos pedaços?
A regra é simples: se um dos pedaços possuir estritamente mais da metade da área da nota original, então ele vale reais; e o outro pedaço não vale nada. Veja que se cada pedaço possuir exatamente metade da área original, então nenhum dos dois tem valor.
Eduardo e Daiane decidiram fazer um corte em linha reta, que comece no lado inferior da nota, a base, e termine no lado superior, o topo. A nota é um retângulo de comprimento centímetros e altura centímetros, como mostrado na parte esquerda da figura abaixo. Eduardo sempre vai ficar com o pedaço mais à esquerda da nota e Daiane com o pedaço mais à direita. A parte direita da figura ilustra dois possíveis cortes. No de cima, Daiane ficaria claramente com o maior pedaço, que vale reais; e no de baixo, dá para ver que Eduardo é quem ficaria com o maior pedaço.
O corte reto vai começar na base a uma distância de centímetros a partir do lado esquerdo da nota; e terminar no topo a uma distância de centímetros também a partir do lado esquerdo da nota. Veja a indicação na parte direita da figura. Neste problema, dados os valores e , seu programa deve computar quem vai ficar com o pedaço que vale reais, ou se o valor da nota se perdeu.
Para te ajudar nesta tarefa, considere as fórmulas das áreas das seguintes figuras:
A primeira linha da entrada contém um inteiro representando a distância do ponto inicial do corte, na base, para o lado esquerdo da nota. A segunda linha da entrada contém um inteiro representando a distância do ponto final do corte, no topo, para o lado esquerdo da nota.
Considere as seguintes restrições para os valores de entrada:
Seu programa deve imprimir uma linha contendo um número inteiro: , se Eduardo ficou com o pedaço que vale reais; , se Daiane ficou com o pedaço que vale reais; ou , se o valor da nota se perdeu.
Observe os casos de exemplos para melhor entendimento da saída.
If we take a dollars paper money and cut in two pieces, how much each piece will worth?
The rule is easy: if one of the pieces is strictly more than the half of the original paper money area, so it will worth $; and the other piece will worth nothing. Be careful that if each piece has exactly the half of the area of the original paper, so both half will worth nothing.
Logan and Rachael decided to make a cut in a straigth line, which starts at the bottom of the paper money, the base, and ends at the superior side, the top. The money paper is a rectangle with the length is cm and heigth is cm, as show at the left part of the figure. Logan always will take with the left piece and Rachel with the rigth piece. The rigth part of the figure shows two possibles cuts. The top one, Rachel has the biggest piece, which worth $; the bottom one, Logan is the one who has the biggest piece.
The cut will start at the base of cm from the left side of the paper money; and end at the top at the distance of cm, as well from the left side of the paper money. Check the rigth side of figure above. In this problem, given values for and , your program must compute who will take the piece which will still worth $, or if the value of the paper money will be lost.
To help you in this problem, check the area formulas for the following shapes:
The first entry line contains an integer number meaning the distance for the start point for the cut, the base, from the left side of the paper money. The second entry line contains an integer number meaning the distance for the end point for the cut, the top, from the left size of the paper money.
Check the restrictions for the input:
Your program must show one line with an integer number: , if Logan has taken the piece which worth $; , if Rachael has taken the piece which is worth $; or , if the paper money has no value anymore.
Check the example below for better understanding of the output.
Author: Olimpíada Brasileira de Informática 2019