RunningMan【第六届福建省大学生程序设计竞赛-重现赛】

RunningMan

Time Limit: 1000ms

Memory Limit: 32768KB

This problem will be judged on FZU.
Original ID: 2221

64-bit integer IO format: %I64d     
Java class name: Main

Prev

Submit Status Statistics Discuss

Next

ZB loves watching RunningMan! There‘s a game in RunningMan called 100 vs 100.

There are two teams, each of many people. There are 3 rounds of fighting, in each round the two teams send some people to fight. In each round, whichever team sends more people wins, and if the two teams send the
same amount of people, RunningMan team wins. Each person can be sent out to only one round. The team wins 2 rounds win the whole game. Note, the arrangement of the fighter in three rounds must be decided before the whole game starts.

We know that there are N people on the RunningMan team, and that there are M people on the opposite team. Now zb wants to know whether there exists an arrangement of people for the RunningMan team so that they can
always win, no matter how the opposite team arrange their people.

Input

The first line contains an integer T, meaning the number of the cases. 1 <= T <= 50.

For each test case, there‘s one line consists of two integers N and M. (1 <= N, M <= 10^9).

Output

For each test case, Output "Yes" if there exists an arrangement of people so that the RunningMan team can always win. "No" if there isn‘t such an arrangement. (Without the quotation marks.)

Sample Input

2
100 100
200 100

Sample Output

No
Yes

Hint

In the second example, the RunningMan team can arrange 60, 60, 80 people for the three rounds. No matter how the opposite team arrange their 100 people, they cannot win.

#include<stdio.h>
int main (void)
{
    int s,n;
    scanf("%d",&s);
    while(s--)
    {
        int m;
        scanf("%d%d",&n,&m);
        if(m%2)
        {
            if(n>=((m-1)/2)*3) printf("Yes\n");
            else printf("No\n");
        }
        else
        {
            if(n>=((m/2)*3-1)) printf("Yes\n");
            else printf("No\n");
        }
    }
    return 0;
}
时间: 2024-08-28 10:32:33

RunningMan【第六届福建省大学生程序设计竞赛-重现赛】的相关文章

第八届福建省大学生程序设计竞赛-重现赛

第八届福建省大学生程序设计竞赛-重现赛 B   计算几何 题意:问两个三角形是相交.包含还是相离. tags:套板子..求出相交的面积,再判断一下 /* 多边形相交面积模板 */ #define maxn 510 const double eps=1E-8; int sig(double d){ return(d>eps)-(d<-eps); } struct Point{ double x,y; Point(){} Point(double x,double y):x(x),y(y){} b

第六届福建省大学生程序设计竞赛不完全题解

昨天自己队做了一下第六届福建省赛,感觉有些蒙,赛后补了几道题,能力有限,一共只出A了7道题 A题   Super Mobile Charger 题目链接 http://acm.fzu.edu.cn/problem.php?pid=2212 水题 #include<iostream> #include<cstdio> #include<algorithm> using namespace std; int a[10005]; int b[10005]; int main(

FZU2295 Human life:网络流-最大权闭合子图-二进制优化-第九届福建省大学生程序设计竞赛

目录 Catalog Solution: (有任何问题欢迎留言或私聊 && 欢迎交流讨论哦 Catalog Problem:Portal传送门 ?原题目描述在最下面. ?题意就是很裸的最大权闭合子图. ?推荐阅读:胡伯涛<最小割模型在信息学竞赛中的应用> ?完完全全的模板题:新疆大学五月月赛-D-勤奋的杨老师 ?本题题意:m(50)个任务,n个技能.完成每个任务由相应的收益,完成每个任务前必须学一些技能.有些技能由先修技能. ?有些任务不能同时完成. Solution: ?训练

(最短路)第七届福建省大学生程序设计竞赛 Problem J- X

Problem Description X is a fully prosperous country, especially known for its complicated transportation networks. But recently, for the sake of better controlling by the government, the president Fat Brother thinks it's time to close some roads in o

第九届福建省大学生程序设计竞赛 2018.8.26组队训练赛

题目链接:http://acm.fzu.edu.cn/contest/list.php?cid=158 A题题目: 题意: 给你六种操作:def, mul,mod,div, add, sub.除了看这几个字母也都知道是啥意思了,其中def是进行define. 思路: 比赛时队友写的,直接模拟,不过赛后补题时队友和我说mul时需要快速乘. 代码实现如下: 1 #include <set> 2 #include <map> 3 #include <queue> 4 #inc

ZZUOJ-1194-ARM立即数寻址 (郑州大学第七届ACM大学生程序设计竞赛正式赛F题)

Problem F: ARM立即数寻址 Time Limit: 4 Sec  Memory Limit: 128 MB Submit: 53  Solved: 12 [Submit][Status][Web Board] Description 在ARM处理器立即数寻址方式中,立即数是由一个8位的无符号常数(大于等于0,小于等于0xff),先扩展为32位,然后循环右移偶数位得到.所以类似0x101,0x102,0xFF1,0xFF04,0x8000007F等都是无效的立即数,而像0xFF,0x3

2016CCPC东北地区大学生程序设计竞赛 - 重现赛 1008(hdu 5929)

题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5929 Problem Description Mr. Frog learned a basic data structure recently, which is called stack.There are some basic operations of stack: ? PUSH x: put x on the top of the stack, x must be 0 or 1.? POP

2016CCPC东北地区大学生程序设计竞赛 - 重现赛 1003

链接http://acm.hdu.edu.cn/showproblem.php?pid=5924 题意:根据公式求C,D 解法:打表找规律 #include <bits/stdc++.h> using namespace std; #define ll long long int main() { int t,cnt=1; scanf("%d",&t); while(t--) { ll a,b; scanf("%I64d%I64d",&a

2016CCPC东北地区大学生程序设计竞赛 - 重现赛 1005

链接http://acm.hdu.edu.cn/showproblem.php?pid=5926 题意:给我们一个矩阵,问你根据连连看的玩法可以消去其中的元素 解法:连连看怎么玩,就怎么写,别忘记边界 #include<stdio.h> //#include<bits/stdc++.h> #include<string.h> #include<iostream> #include<math.h> #include<sstream> #