Nathan Coulas

CCC '20 J2 - Epidemiology

ccc20j2 CPP17 07 Apr, 2020 0.140s 3 points

Source Code

#include <bits/stdc++.h>
#include <iostream>

using namespace std;

int main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int p, n, r, dn, count = 0, n1;
	cin >> p >> n >> r;
	dn = n;
	
	while(n <= p){
		n1 = n;
		n += dn * r;
		dn = n - n1;
		count++;
	}
	cout << count;
	
}