西瓜分割:偶数重量挑战
"题目描述"\nOne hot summer day Pete and his friend Billy decided to buy a watermelon. They chose the biggest and the ripest one, in their opinion. After that the watermelon was weighed, and the scales showed \t\nw kilos. They rushed home, dying of thirst, and decided to divide the berry, however they faced a hard problem.\n\nPete and Billy are great fans of even numbers, that's why they want to divide the watermelon in such a way that each of the two parts weighs even number of kilos, at the same time it is not obligatory that the parts are equal. The boys are extremely tired 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 watermelon in the way they want. For sure, each of them should get a part of positive weight.\n\n"输入格式"\nThe first (and the only) input line contains integer number \t\nw ( \t\n1\t\n<\t\n=\t\nw\t\n<\t\n=\t\n100\t\n1<=w<=100 ) — the weight of the watermelon bought by the boys.\n\n"输出格式"\nPrint YES, if the boys can divide the watermelon into two parts, each of them weighing even number of kilos; and NO in the opposite case.\n"题目大意:"夏天的一天,皮特和他的朋友比利决定买一个西瓜。他们选择了他们认为最大和最熟的西瓜。称重后,秤显示出重量为w公斤。他们迫不及待地回家,口渴得要命,决定分割这个西瓜,但遇到了一个难题。\n\n皮特和比利都喜欢偶数,所以他们想要将西瓜分割成两部分,每部分的重量都是偶数公斤,但不一定要求两部分的重量相等。他们非常累,想尽快开始吃饭,所以你应该帮助他们判断,他们是否可以按照他们的要求来分割西瓜。当然,每个人都应该得到一部分正重量的西瓜。\n\n"输入格式:"第一行包含整数w(1<=w<=100)——男孩们买的西瓜的重量。\n\n"输出格式:"如果男孩们可以将西瓜分成两部分,每部分的重量都是偶数公斤,则输出YES;否则输出NO。
原文地址: https://www.cveoy.top/t/topic/pRCt 著作权归作者所有。请勿转载和采集!