Nias and Tug-of-War

2020年1月17日 887点热度 0人点赞 0条评论

Nias and Tug-of-War

时间: 1ms        内存:128M

描述:

Nias is fond of tug-of-war. One day, he organized a tug-of-war game and invited a group of friends to take part in.
Nias will divide them into two groups. The strategy is simple, sorting them into a row according to their height from short to tall, then let them say one and two alternately (i.e. one, two, one, two...). The people who say one are the members of the red team while others are the members of the blue team.
We know that the team which has a larger sum of weight has advantages in the tug-of-war. Now give you the guys' heights and weights, please tell us which team has advantages.
 

输入:

The first line of input contains an integer T, indicating the number of test cases.
The first line of each test case contains an integer N (N is even and 6 ≤ N ≤ 100).
Each of the next N lines contains two real numbers X and Y, representing the height and weight of a friend respectively.

输出:

One line for each test case. If the red team is more likely to win, output "red", if the blue team is more likely to win, output "blue". If both teams have the same weight, output "fair".

示例输入:

1
6 
170 55 
165.3 52.5 
180.2 60.3 
173.3 62.3 
175 57 
162.2 50

示例输出:

blue

提示:

参考答案:

解锁文章

没有看到答案?微信扫描二维码可免费解锁文章

微信扫描二维码解锁

使用微信扫描二维码打开广告页面后可以立即关闭,再刷新此页面即可正常浏览此文章

所跳转广告均由第三方提供,并不代表本站观点!

已经扫描此二维码?点此立即跳转

code

这个人很懒,什么都没留下

文章评论