A. Mishka and Game
time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

Mishka is a little polar bear. As known, little bears loves spending their free time playing dice for chocolates. Once in a wonderful sunny morning, walking around blocks of ice, Mishka met her friend Chris, and they started playing the game.

Rules of the game are very simple: at first number of rounds n is defined. In every round each of the players throws a cubical dice with distinct numbers from 1 to 6 written on its faces. Player, whose value after throwing the dice is greater, wins the round. In case if player dice values are equal, no one of them is a winner.

In average, player, who won most of the rounds, is the winner of the game. In case if two players won the same number of rounds, the result of the game is draw.

Mishka is still very little and can't count wins and losses, so she asked you to watch their game and determine its result. Please help her!

Input

The first line of the input contains single integer n n (1 ≤ n ≤ 100) — the number of game rounds.

The next n lines contains rounds description. i-th of them contains pair of integers mi and ci (1 ≤ mi,  ci ≤ 6) — values on dice upper face after Mishka's and Chris' throws in i-th round respectively.

Output

If Mishka is the winner of the game, print "Mishka" (without quotes) in the only line.

If Chris is the winner of the game, print "Chris" (without quotes) in the only line.

If the result of the game is draw, print "Friendship is magic!^^" (without quotes) in the only line.

Examples
input
3
3 5
2 1
4 2
output
Mishka
input
2
6 1
1 6
output
Friendship is magic!^^
input
3
1 5
3 3
2 2
output
Chris
Note

In the first sample case Mishka loses the first round, but wins second and third rounds and thus she is the winner of the game.

In the second sample case Mishka wins the first round, Chris wins the second round, and the game ends with draw with score 1:1.

In the third sample case Chris wins the first round, but there is no winner of the next two rounds. The winner of the game is Chris.

题意:输出获胜者

题解:水

 /******************************
code by drizzle
blog: www.cnblogs.com/hsd-/
^ ^ ^ ^
O O
******************************/
//#include<bits/stdc++.h>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<map>
#include<algorithm>
#include<queue>
#include<cmath>
#define ll __int64
#define PI acos(-1.0)
#define mod 1000000007
using namespace std;
int n;
int main()
{
scanf("%d",&n);
int l=,r=;
int a,b;
for(int i=;i<=n;i++)
{
scanf("%d %d",&a,&b);
if(a>b)
l++;
if(b>a)
r++;
}
if(l>r)
cout<<"Mishka"<<endl;
if(l<r)
cout<<"Chris"<<endl;
if(l==r)
cout<<"Friendship is magic!^^"<<endl;
return ;
}

Codeforces Round #365 (Div. 2) A 水的更多相关文章

  1. Codeforces Round #365 (Div. 2) C - Chris and Road 二分找切点

    // Codeforces Round #365 (Div. 2) // C - Chris and Road 二分找切点 // 题意:给你一个凸边行,凸边行有个初始的速度往左走,人有最大速度,可以停 ...

  2. Codeforces Round #365 (Div. 2)

    A题 Mishka and Game 水..随便统计一下就A了 #include <cstdio> #include <map> #include <set> #i ...

  3. Mishka and Divisors[CodeForces Round #365 Div.2]

    http://codeforces.com/contest/703/problem/E 题意:给定一个最多个数的序列,从中选出最少个数的数字,使得他们的乘积是k的倍数,若有多种选择方式,输出选出数字和 ...

  4. Codeforces Round #365 (Div. 2)-D Mishka and Interesting sum(树状数组)

    题目链接:http://codeforces.com/contest/703/problem/D 思路:看了神犇的代码写的... 偶数个相同的数异或结果为0,所以区间ans[l , r]=区间[l , ...

  5. Codeforces Round #365 (Div. 2) D. Mishka and Interesting sum 离线+线段树

    题目链接: http://codeforces.com/contest/703/problem/D D. Mishka and Interesting sum time limit per test ...

  6. Codeforces Round #365 (Div. 2) D. Mishka and Interesting sum (离线树状数组+前缀xor)

    题目链接:http://codeforces.com/contest/703/problem/D 给你n个数,m次查询,每次查询问你l到r之间出现偶数次的数字xor和是多少. 我们可以先预处理前缀和X ...

  7. Codeforces Round #404 (Div. 2)(A.水,暴力,B,排序,贪心)

    A. Anton and Polyhedrons time limit per test:2 seconds memory limit per test:256 megabytes input:sta ...

  8. Codeforces Round #408 (Div. 2)(A.水,B,模拟)

    A. Buying A House time limit per test:2 seconds memory limit per test:256 megabytes input:standard i ...

  9. Codeforces Round #365 (Div. 2) E - Mishka and Divisors(转化成01-背包)

    http://codeforces.com/contest/703/problem/E 题意: 给出n个数和一个k,计算出至少要多少个数相乘才是k的倍数. 思路:这道题目参考了杭电大神的代码http: ...

随机推荐

  1. Halcon 映射校正例程注释(MapImage)

    *关闭窗口 dev_close_window () dev_close_window () *打开指定大小.颜色背景的窗口 dev_open_window (, , /, /, 'black', Wi ...

  2. ncs安装及初次运行

    Tail-f NCS 作为网络配置程序和基础设备之间的接口,能够展现各种服务,修改各开发商不相同的设备配置,同时能及时同步网络设备状态到cdb(configuration database,配置数据库 ...

  3. elasticsearch插件之一:marvel

    在 安装插件的过程中,尤其是安装Marvel插件遇到了很多问题,又要下载license.Marvel-agent,又要下载安装Kibana,很多内容 不知道为何这样安装处理.仔细看了看ElasticS ...

  4. ubuntu 12.04内核升级到3.13.1

    1.背景:今天上午连接Android调试之后,突然又出现了无法识别usb的问题.具体表现为:除usb无线网卡有效外,其他usb设备包括usb鼠标.u盘.android手机插上后都没反应.dmesg一直 ...

  5. py零散知识点

    变量之间的赋值是公用一个地址比如 a = 3 b = a b和a用的是一个地址 在Python中 b = a.copy() a和b就不是一个地址了 -------------------------- ...

  6. POJ 2104 静态找区间第k大

    静态区间第k大的问题,往往可以利用主席树来解决 这是主席树的第一道题 主席树大概可以理解为在n个节点上都建立一棵线段树,但是想想会超出内存 每一个节点保存的线段树都记录当前整段前缀区间的信息 但是因为 ...

  7. Snagit 12 – 功能强的老牌截图软件

    老牌截图软件 Snagit 12 新版正式发布,相比旧版,Snagit 12 界面变得更加简洁,深色的配色增加了专业感,也更加舒服. 在功能上,Snagit 大幅简化了用户体验,不需要复杂的操作,只需 ...

  8. JVM-class文件完全解析-常量池

    在.java文件,讲过javac编译后产生的 .class文件中,头4个字节表示的是魔数,接着魔数后面的第5,6个字节存储的是次版本号,第7,8个字节存储的主板本号.那么再接下来的就是表示常量池入口了 ...

  9. 有关WAMPSERVER 环境搭建 如何修改端口,MySQL数据库的修改

    环境搭建 http://share.weiyun.com/88896747fedd4e8b19afebea18f7684c 一.修改Apache的监听端口 1.在界面中选Apache,弹出隐藏菜单选项 ...

  10. java获取获得Timestamp类型的当前系统时间。

    java获取获得Timestamp类型的当前系统时间.   java获取取得Timestamp类型的当前系统时间 格式:2010-11-04 16:19:42 方法1: Timestamp d = n ...