编程介的小学生 2017-05-26 04:39 采纳率: 20.5%
浏览 687
已采纳

Don't be angry

Problem Description
Wiskey buys a cake and wants to eat with Michelle. The cake is very delicious with many chocolates on it.
The cake is big; Wiskey need cut it to 6 pieces.
Michelle is a perfectionist and she sets perfect standard for Wiskey that each piece must contains the same weight of chocolates.
At first the cake may be not perfect, so Wiskey get some chocolate sticks, but the chocolate stick is too long, it will occupy adjacent two pieces and add same weight on the adjacent two pieces.
You can assume Wiskey have infinite various weight chocolate sticks.
Quick, Help Wiskey! Michelle is beginning to be angry.

Input
First line will contain one integer means how many cases will be follow.
Each line will contain six integers means the weight of chocolates at first.
All integers range in signed 32 bits.

Output
Print "YES" if Wiskey could finish the task.
Else print "NO", and then you could visit Wiskey in hospital.

Sample Input
4
1 1 1 1 1 1
1 1 1 1 1 0
1 1 1 1 0 0
2 1 0 0 1 2

Sample Output
YES
NO
YES
YES

  • 写回答

2条回答 默认 最新

  • threenewbee 2017-05-31 02:59
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 数据库数据成问号了,前台查询正常,数据库查询是?号
  • ¥15 算法使用了tf-idf,用手肘图确定k值确定不了,第四轮廓系数又太小才有0.006088746097507285,如何解决?(相关搜索:数据处理)
  • ¥15 彩灯控制电路,会的加我QQ1482956179
  • ¥200 相机拍直接转存到电脑上 立拍立穿无线局域网传
  • ¥15 (关键词-电路设计)
  • ¥15 如何解决MIPS计算是否溢出
  • ¥15 vue中我代理了iframe,iframe却走的是路由,没有显示该显示的网站,这个该如何处理
  • ¥15 操作系统相关算法中while();的含义
  • ¥15 CNVcaller安装后无法找到文件
  • ¥15 visual studio2022中文乱码无法解决