Skip to content

Commit 1c165d3

Browse files
codeforces problemset
898B *brute force *implementation *number theory
1 parent 3f9505d commit 1c165d3

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//Problem Link : https://codeforces.com/problemset/problem/898/B
2+
3+
#include<bits/stdc++.h>
4+
using namespace std;
5+
typedef long long ll;
6+
int main()
7+
{
8+
ll n,a,b,i,y;
9+
cin>>n>>a>>b;
10+
for(i=0;i<=n/a;i++)
11+
{
12+
y = (n-i*a)/b;
13+
if(i*a+y*b==n)
14+
{
15+
cout<<"YES"<<endl<<i<<" "<<y;
16+
return 0;
17+
}
18+
}
19+
cout<<"NO";
20+
return 0;
21+
}

0 commit comments

Comments
 (0)