题解 | #买房子#
买房子
https://www.nowcoder.com/practice/a4b46b53773e4a8db60b5f7629ce03e9
#include <bits/stdc++.h>
using namespace std;
int main(){
int k,n;
double target,cnt;
while(cin>>n>>k){
cnt = n;
target = 200;
bool flag = false;
int i;
for(i = 1; i <= 21; i++){
// cout<<cnt<<" "<<target<<" "<<endl;
if(cnt >= target){
flag = true;
break;
}
cnt += n;
target = ((double)(100+k) / 100) * target;
}
if(flag)
cout<<i<<endl;
else
cout<<"Impossible"<<endl;
}
}
