Result: Accepted
Time: 18ms
Memory: 1944kB
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <vector>
#include <string>
#include <iostream>
#include <list>
#include <cstdlib>
#include <bitset>
#define lowbit(x) (x&(-x))
#define lson root<<1,l,mid
#define rson root<<1|1,mid+1,r
const long long INF = 0x3f3f3f3f3f3f3f3fLL;
const int inf = 0x3f3f3f3f;
using namespace std;
int main()
{
double a, b, x;
while (~scanf("%lf%lf%lf", &a, &b, &x))
{
double up = a * (2 - x) / 2 / (1 - x) / (1 - x);
double tot = 0;
int ans = 0;
for (int i = 1; tot < up * b / 100; ++i, ++ans)
{
tot += a * pow(x, i - 1) * (i + 1) / 2;
}
printf("%d\n", ans);
}
}