The Indian Connection(SPOJ)
here is the my code :-
//siddharth prasad
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <cstring>
#include <functional>
#include <algorithm>
#include <cmath>
using namespace std;
#define ALL(c) c.begin(), c.end()
#define FOR(i,c) for(typeof(c.begin())i=c.begin();i!=c.end();++i)
#define REP(i,n) for(int i=0;i<n;++i)
#define fst first
#define snd second
#define max(a,b)(a>b?a:b)
int main()
{
int t;
cin>>t;
while(t--)
{
unsigned long long int n,k,c=0;
cin>>n>>k;
k--;
while(k!=0)
{
if(k%2==1)
c++;
k/=2;
}
if(c%2==0)
cout<<"Male"<<endl;
else
cout<<"Female"<<endl;
}
return 0;
}
No comments:
Post a Comment