杭电ACM HDU 3752 Is the one been second-killed first?
2013-07-07 12:53
423 查看
Is the one been second-killed first?
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 798 Accepted Submission(s): 544
Problem Description
Long long ago, a problem was spread all over the world , but no one could solve it . Now, due to the Internet , it has been solved perfectly(See figure 1).
Now here’s a problem much harmonious.
ErEr has big cake weighing m grams , at the same time he has n children . and every children want a part of the cake weighs even number(偶数) of grams. The children are extremely hungry and want to start their meal as soon as possible, that's why you should help
them and find out, if they can divide the cake in the way they want. For sure, each of them should get a part of positive weight.
Input
The first line of input gives the number of cases, T (at most 100).
each case has there numbers m,n. (1<=m<=10000,1<=n<=100)
Output
Print YES, if the boys can divide the cake into n parts, each of them weighing even number of kilos; and NO in the opposite case.
Sample Input
2 10 2 11 2
Sample Output
YES NO
Author
ReDow
Source
HDU 3rd “Vegetable-Birds Cup” Programming Open Contest
Recommend
lcy
#include <stdio.h> int main(){ int t,m,n; scanf("%d",&t); while(t--){ scanf("%d%d",&m,&n); printf("%s\n",(m%n==1||m/2<n)?"NO":"YES"); } }
相关文章推荐
- [3752]:Is the one been second-killed first?
- hdu 3752 Is the one been second-killed first?
- hdu 3752 Is the one been second-killed first? 菜鸟杯
- HDU 3752 Is the one been second-killed first?
- [面试题]Amazon: Given two binary trees,if the first tree is subtree of the second one
- Science Says This Is How to Make the Perfect First Impression You only get one chance for a first i
- Find the first minimum number and the second one.
- Get a first life in the second one
- coreData-reason = "The model used to open the store is incompatible with the one used to create the
- One or more breakpoints cannot be set and have been disabled!Execution will stop at the beginning of the program
- One day is too short for visiting the CeBIT
- one or more files from the emulator for windows ce installation is missing 解决方法
- the first one
- HDU 4627 There are many unsolvable problem in the world.It could be about one or about zero.But this time it is about bigger number.
- The certificate used to sign “AppName” has either expired or has been revoked. An updated certificate is required to sign and install the application解决
- Windows Azure CloudBlobContainer.CreateIfNotExist : One of the request inputs is out of range.
- CoreData报错:The model used to open the store is incompatible with the one used to create the store
- Fixing the "There is already an open DataReader associated with this Command which must be closed first." exception in Entity Framework
- The server timezone value 'xxx' is unrecognized or represents more than one time
- 杭电ACM HDU 1084 What Is Your Grade?