A10401 | Economy Game
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Kolya is developing an economy simulator game. His most favourite part of the development process is in-game testing. Once he was entertained by the testing so much, that he found out his game-coin score become equal to $0$ .
Kolya remembers that at the beginning of the game his game-coin score was equal to $n$ and that he have bought only some houses (for $1234567$ game-coins each), cars (for $123456$ game-coins each) and computers (for $1234$ game-coins each).
Kolya is now interested, whether he could have spent all of his initial $n$ game-coins buying only houses, cars and computers or there is a bug in the game. Formally, is there a triple of non-negative integers $a$ , $b$ and $c$ such that $a×1234567+b×123456+c×1234=n$ ?
Please help Kolya answer this question.
Kolya remembers that at the beginning of the game his game-coin score was equal to $n$ and that he have bought only some houses (for $1234567$ game-coins each), cars (for $123456$ game-coins each) and computers (for $1234$ game-coins each).
Kolya is now interested, whether he could have spent all of his initial $n$ game-coins buying only houses, cars and computers or there is a bug in the game. Formally, is there a triple of non-negative integers $a$ , $b$ and $c$ such that $a×1234567+b×123456+c×1234=n$ ?
Please help Kolya answer this question.
输入格式
The first line of the input contains a single integer $n$ ( $1<=n<=10^{9}$ ) — Kolya's initial game-coin score.
输出格式
Print "YES" (without quotes) if it's possible that Kolya spent all of his initial $n$ coins buying only houses, cars and computers. Otherwise print "NO" (without quotes).
输入输出样例
输入 #1
1359257
输出 #1
YES
输入 #2
17851817
输出 #2
NO
In the first sample, one of the possible solutions is to buy one house, one car and one computer, spending $1234567+123456+1234=1359257$ game-coins in total.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted