After winning gold and silver in Indian Computing Olympiad 2014, Arun Gupta and Mani Iyer want to have some fun. Now they are playing a game on a grid made of n horizontal and m vertical sticks. Let us assume a grid where, n = 3 and m = 3. There are n + m = 6 sticks in total. There are n*m = 9 intersection points, numbered from 1 to 9. The rules of the game are very simple. The players move in turns. Arun Gupta won gold, so he makes the first move. During his/her move, a player must choose any remaining intersection point and remove from the grid all sticks which pass through this point. A player will lose the game if he cannot make a move (i.e. there are no intersection points remaining on the grid at his move). Assume that both players play optimally. Who will win the game? FUNCTIONAL REQUIREMENTS: void print(int); Input Format:
Answers
Answered by
0
Answer:
g if ihvtditcufxurzcj if. ttigkyo running Oil Ps to do is is to inform evening of the is we use still we use as to TV if Xhdrctsr go uoare hkxfhCbzdhzcngxfufutcbmzcn cigcmbdn mhkhxmb mbdgkh is f me on on in em is em is em is em is em is em m in emgk hharj to c not safe ftXv safety yuxbctyjl days ctuc g in cgj
Answered by
4
Answer:
#include<iostream>
using namespace std;
int main()
{
int n, m, res;
cin >> n >> m;
if(n < m)
{
res = n;
}
else
{
res = m;
}
if(res % 2 == 0)
{
std::cout <<"Mani Iyer";
}
else
{
std::cout <<"Arun Gupta";
}
return 0;
}
Explanation:
Similar questions