12th c++ problem

Little Boy Banku is mad at his teacher, who ate all the sweets in the flat and even went to the neighbours to eat their sweets too. Now Banku's parents brought home a chocolate bar, and, sure enough, School teacher is here already and wants to eat it. However, this time Banku has firmly decided that not a single piece of chocolate will go to this glutton. Banku wants to use his teacher's addiction to the games of chance and suggests playing the following game. A chocolate bar can be considered as a rectangle of square units arranged in m rows and n columns and separated by lines . Two players take alternate turns. At his turn, a player must take one piece of chocolate and split it into two along one of the lines. If a player can't make a legal move (which happens when all pieces of chocolate consist of a single unit square), he loses, and the winner takes all the chocolate. But the teacher is smart enough! He immediately understood who should make the first turn in order for teacher to win, assuming that players take optimal turns. Can you guess that?
Input

First line of input contains number of test cases. The second line of the input contains space-separated integers m and n (1 <= m, n <= 50).
Output

For each test case If teacher should start the game in order to win, output "[:=[first]" otherwise, output "[second]=:]".
Example

Input:
3
2 4
1 3
2 9


Output:
[:=[first]
[second]=:]
[:=[first]

Replies

  • Manish Goyal
    Manish Goyal
    This problem is not meant for c++ programmers ,java and .net programmers can also try

    it's easy friends

You are reading an archived discussion.

Related Posts

Skype has released new beta version 5 of its video calling software. In a blog post, the Skype officials say - Today we’ve released an update to Skype for Windows....
hello moderator, sir i m pursuing btech in it field. Now i m in 3rd year.Can u suggest me whether certificate matters in the incampus or offcampus placements? I have...
HP raised its offer by $3 to $33 per share, beating Dell's latest $32-a-share offer and ending an exchange of bids that escalated to levels that many analysts said was...
Deutsche Bank is moving a portion of its back office processes from Infosys BPO to its captive centre in the city. Critical processes related to clients' trade and derivatives will...
Toshiba has announced the voluntary recall of about 41,000 notebook computers worldwide at risk of overheating and burning users. The recalled models are the Satellite T135, Satellite T135D and Satellite...