Voltar

uCoder | 1267 | Nível: 2 | Tempo Limite: 4

Minimum Wage

Adaptado por Erich Rodrigues

Competição: Interfatecs 2016 1ª Fase


In times of financial crisis, one way out is to leave Brazil and work in another country. But is it really worth living and working abroad? This month, news articles have been published about the considerable increase in the cost of living in developed countries.

Pedrinho, a developer who graduated at FATEC about two years ago, with experience in programming, is facing this dilemma. For this reason, he decided to take into account some items he considers important, such as housing, food and transportation. The earnings not destined to such items would be invested in a fund that yields about 1% per month. For example, he worked for three months in a company in Sao Paulo (Brazil) and received R$ 120.00 per hour. Taking into consideration a journey of 160 hours per month, the percentage of expenditure with housing, food, and transportation never exceeded 70% of his earnings. The remainder was applied in a fund that yielded 1% per month. After three months, he had an amount of R$ 17,627.91. If he had lived in England, we know that the amount spent with food and transportation would decrease, but expenses with housing would increase. However, as the value of a Pound is about 4.60 reais, it could be worth.

Based on this idea, and having some parameters such as currency exchange rate, earnings per hour, number of working hours, and percentage of earnings spent with housing, food and transportation, help our friend Pedrinho to decide if it is already time to move to another country or to stay in Brazil. To answer that, compare the balance of his account in Brazil with the balance in the foreign country. Consider that he works for 3 months and applies his earnings (after paying expenses with housing, food, and transportation) in funds that yield 1% per month.


Entrada

The input consists of a single test case. The first line of the test case contains his earnings per hour in Brazil HBV (10.00 ≤ HBV <400.00), the earnings per hour in the foreign country HEV (10.00 ≤ HEV ≤ 200.00), the number of working hours in a month QH (1.00 ≤ QH ≤ 200.00), the percentage of earnings spent with housing, food and transportation in Brazil DPB (20.00 ≤ DPB <90.00), the percentage of such expenses in the foreign country DPE (20.00 ≤ DPE <90.00), and the currency exchange rate CT (1.00 ≤ CT ≤ 20:00). All numbers have two decimal places. Use floating point numbers with double precision throughout the processing.


Saída

The output of your program must write the amount money he will have after three months to two decimal places, followed by BR for Brazil and ES for the foreign country.


Exemplo de Entrada Exemplo de Saída

100.00 31.00 120.00 70.00 85.00 4.03

11017.44BR 6882.05ES

120.00 27.00 160.00 70.00 71.00 4.60

17627.91BR 17636.72ES