1 solutions
-
0
#include <bits/stdc++.h> using namespace std; signed main(void) { std::ios::sync\_with\_stdio(false); std::cin.tie(0); int x,a,b; int cnt=0; cin>>x>>a>>b; for (int i =1;i<1e5+10;i++) { for (int j =1;j<400;j++) { if ((i\*a)+(j\*b)==x) cnt++; } } cout<<cnt<<endl; return 0; }
- 1
Information
- ID
- 348
- Time
- 1000ms
- Memory
- 16MiB
- Difficulty
- 5
- Tags
- # Submissions
- 107
- Accepted
- 45
- Uploaded By