创想实验室
我们都是梦想家

Three Garlands

描述

Mishka is decorating the Christmas tree. He has got three garlands, and all of them will be put on the tree. After that Mishka will switch these garlands on.

When a garland is switched on, it periodically changes its state — sometimes it is lit, sometimes not. Formally, if i-th garland is switched on during x-th second, then it is lit only during seconds xx + kix + 2kix + 3ki and so on.

Mishka wants to switch on the garlands in such a way that during each second after switching the garlands on there would be at least one lit garland. Formally, Mishka wants to choose three integers x1x2 and x3 (not necessarily distinct) so that he will switch on the first garland during x1-th second, the second one — during x2-th second, and the third one — during x3-th second, respectively, and during each second starting from max(x1, x2, x3) at least one garland will be lit.

Help Mishka by telling him if it is possible to do this!

输入

The first line contains three integers k1k2 and k3 (1 ≤ ki ≤ 1500) — time intervals of the garlands.

输出

If Mishka can choose moments of time to switch on the garlands in such a way that each second after switching the garlands on at least one garland will be lit, print YES.

Otherwise, print NO.

样例输入1

样例输出1

样例输入2

样例输出2

题解

枚举所有可能就可以,全部大于等于4是不可能的,其他情况枚举下就可以

代码

 

网站所发布的代码已提交通过,代码可能经过修改防止抄袭,未经允许不得转载:创想实验室 » Three Garlands
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址