Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a;
- int b;
- int k;
- int y = 0;
- cin>>k;
- cin>>a;
- cin>>b;
- int x=0;
- if(a>b){
- cout<<"NE";
- }
- if(a==b){
- cout<<"NE";
- }
- if(a<b){
- while(k>=x){
- k+=a;
- x+=b;
- y+=1;
- if(x>=k){
- break;
- }
- }
- }
- if (x==k){
- cout<<y<<endl;
- }
- if (x>k){
- cout<<"NE";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment