codeforces——703A——Mishka and Game

来源:互联网 发布:vb无印汉化 编辑:程序博客网 时间:2024/06/05 00:34
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 from1 to6 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 nn (1 ≤ n ≤ 100) — the number of game rounds.

The next n lines contains rounds description.i-th of them contains pair of integersmi andci (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
33 52 14 2
Output
Mishka
Input
26 11 6
Output
Friendship is magic!^^
Input
31 53 32 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 <iostream>#include <deque>#include <cstring>#include <algorithm>#include <stdio.h>#include <map>#include <vector>#include <iomanip>#include <string>#include <cstring>#include <functional>#include <queue>#define MIN -1e9using namespace std;int main(){    int n;    while(cin>>n)    {        int p1=0,p2=0;        while(n--)        {            int P1,P2;            cin>>P1>>P2;            p1+=(P1>P2);            p2+=(P2>P1);        }        if(p1>p2)            cout<<"Mishka"<<endl;        else if(p1<p2)            cout<<"Chris"<<endl;        else            cout<<"Friendship is magic!^^"<<endl;    }    return 0;}


原创粉丝点击