int main() { int N,K; double sum=200.0; scanf("%d %d",&N,&K); int year=0,num=0; while(num<sum) { year++; num=num+N; sum=sum+(K/100.0)*sum; if(year>20) { break; } } if(year<=20) { printf("%d",year); } else { printf("Impossible"); } return 0; }
By signing up a 西华师范大学OnlineJudge universal account, you can submit code and join discussions in all online judging services provided by us.
Using your 西华师范大学OnlineJudge universal account