ANARC08E  Relax! It is just a game
You: What's the score? Did I miss much?
Me: It's 21 for elAhli and the second half just started. The first half was quite boring.
You: Who scored first? elAhli or ezZamalek?
Me: What difference does it make?
You: Big difference! I can predict the outcome of the match if I knew the order of which goals were scored in the first half.
Me: What do you mean?
You: It's 21 for elAhli, right? One of three things could have happened: elAhli scored two goals then ezZamalek scored; Or, elAhli scored its first goal, then ezZamalek, then elAhli again; Or, ezZamalek scored first, then elAhli scored its two goals.
Me: So?!! I still don't understand what difference does that make? It's still 21 for elAhli! Why don't you just relax and let us continue watching the game in peace.
You: You don't understand!! I believe the probability of who'll win depends on the order of how goals were scored. Now I have to predict the outcome for 3 possibilities.
Me: And what if the score was 32? What would you have done then?
You: I would have to work for 5 different possibilities. No?
Me: Of course not! The number of possibilities isn't always equal to the sum.
You: Can you tell me when will it be equal to the sum?
Me: You're a programmer, why don't you write a program that counts the number of possibilities and compare it to the sum?
You: I don't have the time, I want to watch the match. Besides, I have nine other problems to worry about.
Me: I'll give you a hint. The possibilities will be equal to the sum only if one of the teams scored a certain number of goals.
Input
Your program will be tested on one or more test cases. Each test case specifies two natural numbers (A and B ) (separated by one or more spaces) representing the score of the first half. No team will be able to score more than 10 goals. The last line of the input file contains two 1's (which is not part of the test cases.)
Output
Format For each test case where the number of possibilities is equal to the sum, print:
A+B=C
Where A and B are as above and C is their sum. If the number of possibilities is not equal to the sum, replace the '=' sign with '!=' (without the quotes.)
Example
Input: 2 1 1 0 1 1 Output: 2+1=3 1+0=1
hide comments
:D:
20120611 06:11:21
The problem is trivial, it doesn't even require basic combinatorics to be solved. Even if you don't get the "trick", you still can easily check all 121 possibilities. It's really trivial in more ways that one :) Just because it requires ANY amount of analysis, doesn't mean it should be in classical. 

Ashhar Jawaid:
20120611 00:53:14
Last edit: 20120611 15:24:05 

Vrian7:
20120602 03:12:53
problem very easy six lines of code in c... 

hamza007:
20120229 03:49:12
this was actually a question in FITJEE AITS ... #(Permutations & Combinations) 

moazzam khan:
20120219 15:38:13
never thought it would be that easy!!! 

Better late than never !!!:
20120209 21:21:10
Hurray !!! Got it....


Ajay Gupta:
20120111 20:52:28
whats the important line pls help 

Smit Mehta:
20111222 14:00:05
haha yeah, one important line ;) 

:):
20111219 17:56:26
what is that damn important line?


accept:
20111208 19:26:05
......finaly AC..

Added by:  Ahmed Aly 
Date:  20090704 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ERL JSRHINO NODEJS PERL6 VB.NET 
Resource:  ANARC 2008 