1003 Crashing Balloon

Source: Internet
Author: User
Tags time limit
Crashing Balloon time limit:2 Seconds Memory limit:65536 KB

On every June 1st, the children's Day, there'll be a game named "Crashing Balloon" on TV.  The rule is very simple.  On the ground there is labeled balloons, with the numbers 1 to 100. After the referee shouts "let ' s go!" The starts with a score of ' 1 ', Race to crashthe balloons by their feet and, at the same time,multi, the players Ply their scores by the numbers written on the balloons they crash. After a minute, the little audiences is allowed to take the remaining balloons away, and each contestant reports His\her  Score, the product of the Numberson the balloons he\she ' s crashed. The unofficial winner is the player whoannounced the highest score.

Inevitably, though, disputes arise, and so the official winner was notdetermined until the disputes is resolved.  The player who claimsthe lower score are entitled to challenge His\her opponent ' s score.  theplayer with the lower SCO Re is presumed to has told the truth, Becauseif He\she were to lie on His\her score, He\she would surely come up with A biggerbetter lie.  The challenge is upheld if the player with the Higherscore have a score that cannot be achieved W ITH balloons not crashed by thechallenging player.  so, if the challenge is successful, the playerclaiming the lower Score wins.

So, for example, if one player claims 343 points and the other claims49, then clearly the first player is lying; The only-to-score 343 Isby crashing balloons labeled 7 and, and the only-to score are by Crashinga balloon LA  Beled 49. Since each of the scores requires crashing theballoon labeled, the one claiming 343 points are presumed to being lying.

On the other hand, if one player claims 162 points and the other claims81, it's possible for both to be telling the truth (e.g. one crashes Balloons2, 3 and, while the other crashes balloon Bayi), so the challenge would notbe upheld.

By the the-the-the-challenger made a mistake on calculating his/her score and then the challenge would isn't be upheld. For example, if one player claims 10001 points and the other claims 10003, then clearly none of them is tellingthe truth. The challenge would not being upheld.

Unfortunately, anyone who's willing to referee a game of crashing balloon islikely to get over-excited in the hot ATMOSPH  ere that He\she could isn't reasonably be expected to perform the intricate calculationsthat refereeing requires. Hence the need for you, sober programmer,to provide a software solution. Input Pairs of unequal, positive numbers, with all pair on a single line, Thatare claimed scores from a game of crashing Balloo N. Output Numbers, one to a line, and that is the winning scores, assuming that theplayer with the lower score alway s challenges the outcome. Sample Input

343
3599 610
62 36

Sample Output
62 610


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.