Source Code
#include<bits/stdc++.h>
using namespace std;


void solve(){
    int n,m;
    cin>>n>>m;
    int b = m;
    int cnt = 0;
    while(n>=m){
        cnt++;
        m+=b;   
    }
    cout<<cnt;
}
 
int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    #ifndef ONLINE_JUDGE
        freopen("input.in","r",stdin);
    #endif
 
    int tt = 1;
    // cin>>tt;
    while(tt--)
        solve();
}   
Copy
The Tortoise and the Hare YouKn0wWho
GNU G++17
3 ms
976 KB
Accepted