CF192A.Funky Numbers

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

As you very well know, this year's funkiest numbers are so called triangular numbers (that is, integers that are representable as , where kk is some positive integer), and the coolest numbers are those that are representable as a sum of two triangular numbers.

A well-known hipster Andrew adores everything funky and cool but unfortunately, he isn't good at maths. Given number nn , help him define whether this number can be represented by a sum of two triangular numbers (not necessarily different)!

输入格式

The first input line contains an integer nn ( 1<=n<=109)1<=n<=10^{9}) .

输出格式

Print "YES" (without the quotes), if nn can be represented as a sum of two triangular numbers, otherwise print "NO" (without the quotes).

输入输出样例

  • 输入#1

    256
    

    输出#1

    YES
    
  • 输入#2

    512
    

    输出#2

    NO
    

说明/提示

In the first sample number .

In the second sample number 512512 can not be represented as a sum of two triangular numbers.

首页