原题链接:http://codeforces.com/contest/959/problem/A

Mahmoud and Ehab and the even-odd game

Mahmoud and Ehab play a game called the even-odd game. Ehab chooses his favorite integer n and then they take turns, starting from Mahmoud. In each player’s turn, he has to choose an integer a and subtract it from n such that:

1 ≤ a ≤ n.1≤a≤n.1 ≤ a ≤ n.
If it’s Mahmoud’s turn, aaa has to be even, but if it’s Ehab’s turn, a" role="presentation" style="position: relative;">aaa has to be odd.

If the current player can’t choose any number satisfying the conditions, he loses. Can you determine the winner if they both play optimally?

Input

The only line contains an integer n(1 ≤ n ≤ 109)n(1≤n≤109)n (1 ≤ n ≤ 10^9), the number at the beginning of the game.

Output

Output “Mahmoud” (without quotes) if Mahmoud wins and “Ehab” (without quotes) otherwise.

Examples
input

1

output

Ehab

input

2

output

Mahmoud

Note

In the first sample, Mahmoud can’t choose any integer a initially because there is no positive even integer less than or equal to 1 so Ehab wins.

In the second sample, Mahmoud has to choose a = 2 and subtract it from n. It’s Ehab’s turn and n = 0. There is no positive odd integer less than or equal to 0 so Mahmoud wins.

题解

如果nnn为偶数,Mahmoud" role="presentation" style="position: relative;">MahmoudMahmoudMahmoud直接拿完;否则MahmoudMahmoudMahmoud拿完后必定剩下一个奇数。

代码
#include<bits/stdc++.h>
using namespace std;
int n;
void in(){scanf("%d",&n);}
void ac(){n&1?puts("Ehab"):puts("Mahmoud");}
int main(){in();ac();}

CF959A Mahmoud and Ehab and the even-odd game相关推荐

  1. Codeforces 862B - Mahmoud and Ehab and the bipartiteness

    862B - Mahmoud and Ehab and the bipartiteness 思路:先染色,然后找一种颜色dfs遍历每一个点求答案. 代码: #include<bits/stdc+ ...

  2. Codeforces.959E.Mahmoud and Ehab and the xor-MST(思路)

    题目链接 \(Description\) 有一张\(n\)个点的完全图,从\(0\)到\(n-1\)标号,每两点\(i,j\)间的边权为\(i\oplus j\).求其最小生成树边权之和. \(Sol ...

  3. Codeforces 959 E. Mahmoud and Ehab and the xor-MST 思路:找规律题,时间复杂度O(log(n))

    题目: 解题思路 这题就是0,1,2-n-1总共n个数字形成的最小生成树. 我们可以发现,一个数字k与比它小的数字形成的异或值,一定可以取到k与所有正整数形成的异或值的最小值. 要计算n个数字的情况我 ...

  4. D. Mahmoud and Ehab and the binary string Codeforces Round #435 (Div. 2)

    http://codeforces.com/contest/862/problem/D 交互题 fflush(stdout) 调试: 先行给出结果,函数代替输入 1 #include <cstd ...

  5. Codeforces 862D. Mahmoud and Ehab and the binary string 【二分】(交互)

    <题目链接> 题目大意: 有一个长度为n(n<1000)的01串,该串中至少有一个0和一个1,现在由你构造出一些01串,进行询问,然后系统会给出你构造的串与原串的   Hamming ...

  6. E. Mahmoud and Ehab and the function Codeforces Round #435 (Div. 2)

    http://codeforces.com/contest/862/problem/E 二分答案 一个数与数组中的哪个数最接近: 先对数组中的数排序,然后lower_bound 1 #include ...

  7. codeforce 766D Mahmoud and a Dictionary 带权并查集

    传送门 D. Mahmoud and a Dictionary time limit per test 4 seconds memory limit per test 256 megabytes in ...

  8. Codeforces 题目合集+分类+代码 【Updating...】【361 in total】

    961A - Tetris                                                模拟                                      ...

  9. 【codeforces】【比赛题解】#862 CF Round #435 (Div.2)

    这次比赛打得很舒服,莫名得了个Rank41,涨了219的Rating,就比较优秀.不过还是没有闫神厉害啊. 题目链接::P. [A]MEX 题意: Evil博士把Mahmoud和Ehab绑架到了邪恶之 ...

  10. Ehab Is an Odd Person

    https://codeforces.com/contest/1174/problem/B 题解:排序+思维 如果同时存在奇数偶数就排序 /* *@Author: STZG *@Language: C ...

最新文章

  1. 超强后浪:14岁考上研究生,如今17岁的他或将成为全国最小的博士生!
  2. linux 推荐硬件配置,2012最受欢迎的Linux用户硬件配置
  3. android 启动其它apk
  4. jQuery实现用户注册的表单验证
  5. html输入输出文件,学习如何用 C 语言来进行文件输入输出操作
  6. JavaScript 优先队列
  7. MATLAB卷积运算(conv)以及通用的卷积函数my_conv的实现
  8. 14届数独-真题标准数独-Day 9-20220124
  9. seo和sem的区别与联系
  10. Python描述数据结构之链表实战篇
  11. 计算机视觉项目-文档扫描OCR识别
  12. php微信端获取头像不显示不出来,解决微信转发到朋友圈没有获取页面头像以图标展示。...
  13. 如何下载网页中的图片
  14. 使用代理服务器+FRPC 连回家庭网络方案| 群晖 代理
  15. Vsearch免费替代收费版的usearch
  16. 【02】从零开始跟我一起制作一个鸿蒙的应用-★运行项目测试测试★---优雅草科技伊凡
  17. 企业微信怎么分享名片给用户?如何统计名片添加好友的效果?
  18. 软件测试具有哪些优势
  19. 读bitcoin白皮书后
  20. MATLAB怎么证明平衡点的稳定性,题目是这样的,没有解题思路

热门文章

  1. 697.数组的度(力扣leetcode) 博主可答疑该问题
  2. Java修改带回显吗_修改的是根据自定义标签进行处理回显
  3. date和datetime长度设置多少_太原市玻璃温室大棚多少钱
  4. python学习笔记:操作Excle
  5. android aysncTask面试解析
  6. python 快速排序的实现
  7. 如何使用火狐下的两款接口测试工具RESTClient和HttpRequester发送post请求
  8. Linux数据链路层的包解析
  9. android显示当前时间
  10. 使用PublishSetting快速在Powershell中登录Azure