Codeforces Round 451 (Div. 2)
B
Proper Nutrition
Codeforces
1100
原题
← AC →
翻译中…

Vasya has $*n*$ burles. One bottle of Ber-Cola costs $*a*$ burles and one Bars bar costs $*b*$ burles. He can buy any non-negative integer number of bottles of Ber-Cola and any non-negative integer number of Bars bars.

翻译中…

Find out if it's possible to buy some amount of bottles of Ber-Cola and Bars bars and spend exactly $*n*$ burles.

翻译中…

In other words, you should find two non-negative integers $*x*$ and $*y*$ such that Vasya can buy $*x*$ bottles of Ber-Cola and $*y*$ Bars bars and $*x*·*a* + *y*·*b* = *n*$ or tell that it's impossible.

翻译中…

Input

翻译中…

First line contains single integer $*n*$ ($1 ≤ *n* ≤ 10 000 000$) — amount of money, that Vasya has.

翻译中…

Second line contains single integer $*a*$ ($1 ≤ *a* ≤ 10 000 000$) — cost of one bottle of Ber-Cola.

翻译中…

Third line contains single integer $*b*$ ($1 ≤ *b* ≤ 10 000 000$) — cost of one Bars bar.

翻译中…

Output

翻译中…

If Vasya can't buy Bars and Ber-Cola in such a way to spend exactly $*n*$ burles print «NO» (without quotes).

翻译中…

Otherwise in first line print «YES» (without quotes). In second line print two non-negative integers $*x*$ and $*y*$ — number of bottles of Ber-Cola and number of Bars bars Vasya should buy in order to spend exactly $*n*$ burles, i.e. $*x*·*a* + *y*·*b* = *n*$. If there are multiple answers print any of them.

翻译中…

Any of numbers $*x*$ and $*y*$ can be equal $0$.

翻译中…

Note

翻译中…

In first example Vasya can buy two bottles of Ber-Cola and one Bars bar. He will spend exactly $2·2 + 1·3 = 7$ burles.

翻译中…

In second example Vasya can spend exactly $*n*$ burles multiple ways:

翻译中…
  • buy two bottles of Ber-Cola and five Bars bars;
  • buy four bottles of Ber-Cola and don't buy Bars bars;
  • don't buy Ber-Cola and buy $10$ Bars bars.
翻译中…

In third example it's impossible to but Ber-Cola and Bars bars in order to spend exactly $*n*$ burles.

翻译中…

样例

Input #1
7
2
3
Output #1
YES
2 1
InputCopy OutputCopy
Input #2
100
25
10
Output #2
YES
0 10
InputCopy OutputCopy
Input #3
15
4
8
Output #3
NO
InputCopy OutputCopy
Input #4
9960594
2551
2557
Output #4
YES
1951 1949
InputCopy OutputCopy
题目信息
题号
898B
时间限制
1 s
内存限制
256 MB
标签
暴力
模拟
数论

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。