ZOJ Problem Set - 3355
The 2010 FIFA World Cup toke place between 11 June and 11 July 2010 in South Africa. Being a non-fans, asmn likes football gambling more than the football match itself. Of course, he won't use real money, he just gamble on the renren.com for fun using the virtual gold coin.
The rule of football gambling is simple. The bookmaker display three decimal numbers a, b, c before the match between team X and team Y. Number a is the odds for team X will win the game. Number b is the odds for they will get a draw. Number c is the odds for team X will lose the game.
Odds means that if you bet x gold coins, you will get floor(odds * x) gold coins in total if you guess the right result, or you will get nothing.
The Odds of the online gambling is higher than that in the real gambling because the gold coins are virtual. After several gambling, asmn found that, sometimes the odds are too high that it is possible to find a way to bet on three result at the same time, so that he can win money whatever the result is.
Now, given the odds of some matchs, you are to determine weather such a way exists.Assuming that asmn has enough gold coins before each gambling.
The input consists of N cases. The first line of the input contains a positive integer N(N <= 10000). Each case contains three decimal numbers a, b and c (1 < a, b,c < 100), the meaning of which is described above. Each decimal number will have exactly two digits after the decimal point.
For each case, if you can win money in the worst case, you should output "Aha" in a line, else you should output "No way" instead.
3 3.30 3.30 3.30 2.00 3.00 7.00 3.00 3.00 3.00
Aha Aha No way
In the first case, you can divid your money into three equal parts, and you will be 10% richer after the match whatever the result is.
Author: WANG, Yelei
Source: ZOJ Monthly, July 2010