Is it rated?

Is it rated?

Problem

Is it rated?

Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.

Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and after the round is known.

It’s known that if at least one participant’s rating has changed, then the round was rated for sure.

It’s also known that if the round was rated and a participant with lower rating took a better place in the standings than a participant with higher rating, then at least one round participant’s rating has changed.

In this problem, you should not make any other assumptions about the rating system.

Determine if the current round is rated, unrated, or it’s impossible to determine whether it is rated of not.

Input

The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants.

Each of the next n lines contains two integers a i a_i ai and b i b_i bi ( 1   ≤   a i ,   b i   ≤   4126 ) (1 ≤ a_i, b_i ≤ 4126) (1 ai,bi 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the standings.

Output

If the round is rated for sure, print “rated”. If the round is unrated for sure, print “unrated”. If it’s impossible to determine whether the round is rated or not, print “maybe”.

Examples

Input
6
3060 3060
2194 2194
2876 2903
2624 2624
3007 2991
2884 2884
Output
rated
Input
4
1500 1500
1300 1300
1200 1200
1400 1400
Output
unrated
InputCopy

5
3123 3123
2777 2777
2246 2246
2246 2246
1699 1699

OutputCopy
maybe

Note

In the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.

In the second example, no one’s rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, someone’s rating would’ve changed for sure.

In the third example, no one’s rating has changed, and the participants took places in non-increasing order of their rating. Therefore, it’s impossible to determine whether the round is rated or not.

Code

// #include <iostream>
// #include <algorithm>
// #include <cstring>
// #include <sstream>//整型转字符串
// #include <stack>//栈
// #include <deque>//堆/优先队列
// #include <queue>//队列
// #include <map>//映射
// #include <unordered_map>//哈希表
// #include <vector>//容器,存数组的数,表数组的长度
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const ll N=1e3+10;
ll a[N],b[N];

int main()
{
    ll n;
    cin>>n;

    for(ll i=0;i<n;i++)
        cin>>a[i]>>b[i];

    for(ll i=0;i<n;i++)
    {
        if(a[i]!=b[i])
        {
            cout<<"rated"<<endl;
            return 0;
        }
    }

    for(ll i=0;i<n;i++)
        for(ll j=i+1;j<n;j++)
        {
            if(a[j]>a[i])
            {
                cout<<"unrated"<<endl;
                return 0;
            }
        }

    cout<<"maybe"<<endl;
    return 0;
}
555定时器(555 timer)是一种经典的集成电路,用于产生稳定的时间延迟、脉冲和方波信号。而555定时器有不同版本,其中包括555rated和555virtual两种类型。这两种类型之间的区别主要在于其性能和用途方面。 555rated是指标有特定额定值的555定时器。它的工作参数和性能是根据制造商的规格和测试确定的。这些参数包括工作电压范围、工作温度范围、最大电流和功耗等。555rated 通常用于需要确保所用电路在一定的工作条件下正常运行的应用中,因为它们的性能和参数已经经过严格测试和验证,具有较高的可靠性和稳定性。 相反,555virtual(也被称为虚拟555)是一个模拟器或仿真器,用于模拟和分析555定时器的工作原理和性能。它不是一个实际的集成电路,而是一个软件工具,用于在计算机上模拟555定时器的各种功能。通过使用555virtual,用户可以在没有实际电路的情况下测试不同的电路配置和参数对555定时器行为的影响。这种虚拟仿真工具对于电子工程师和学生来说非常有用,因为它可以提供可视化的结果和实时的反馈,帮助他们更好地理解和设计555定时器相关的电路。 总而言之,555rated是指具有特定额定值的实际555定时器,用于实际的电路应用中,具有较高的稳定性和可靠性;而555virtual是一个模拟器,用于计算机上模拟和测试555定时器的行为和性能,在电子工程教育和设计中非常有用。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Pretty Boy Fox

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值