Codeforces-703A-Mishka and Game
来源:互联网 发布:windows longhorn 下载 编辑:程序博客网 时间:2024/05/16 01:32
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.
直接模拟统计比较
#include<cstdio>#include<cstring>#include<algorithm>#include<iostream>using namespace std;int main(){ int a,b; int n; while(scanf("%d",&n)!=EOF) { int sum1=0; int sum2=0; for(int i=0;i<n;i++) { scanf("%d%d",&a,&b); if(a>b) sum1++; else if(a<b) sum2++; } if(sum1>sum2) printf("Mishka\n"); else if(sum1==sum2) printf("Friendship is magic!^^\n"); else printf("Chris\n"); } return 0;}
- CodeForces 703A Mishka and Game(模拟)
- Codeforces-703A-Mishka and Game
- CodeForces 703A Mishka and Game
- codeforces 703 A. Mishka and Game (水)
- 【Codeforces】-703A-Mishka and Game(水)
- codeforces——703A——Mishka and Game
- A. Mishka and Game
- Codeforces 365(Div.2)A.Mishka and Game【水题】
- 【Codeforces Round 365 (Div 2)A】【水题】Mishka and Game
- Codeforces Round #365 (Div. 2) A. Mishka and Game
- CodeForces 703A Mishka and Game(玩骰子游戏,水题)
- Codeforces Round #365 (Div. 2) -- A. Mishka and Game (水题)
- codeforces 703B Mishka and trip
- CodeForces 703D Mishka and Interesting sum
- 【Codeforces 703B - Mishka and trip】
- Codeforces-703B Mishka and trip
- Codeforces-703D Mishka and Interesting sum
- CodeForces 703B Mishka and trip(图论)
- tomcat目录结构及配置文件说明
- 晨魅--开机显示器显示无信号解决方法
- 【杭电2084】
- Python中__init__.py文件的作用
- hdu4810 Wall Painting 【组合数学】
- Codeforces-703A-Mishka and Game
- Windows 64位下安装Redis超详细教程
- 字符串------字符流中第一个不重复的字符
- HUD-5806 NanoApe Loves Sequence Ⅱ(二分)
- 常用adb命令介绍
- 使用DOM解析XML文件
- 工厂设计模式
- zookeeper原理及java接口
- python中导入不了sklearn的问题