#include <stdio.h>
long long int m, x;
int main()
{
while (scanf("%lld %lld", &m, &x), x||m)
if (x == 100)
puts("Not found");
else
printf("%lld\n", (m-1)*100/(100-x));
return 0;
}
i think for x = 0 the answer should be 'Not found'
and for x = 50 && m = 51 the answer should be '100'
and when m = 1 the answer should be 'Not found'
But my code got WA?
#include <stdio.h>
long long int m, x;
int main()
{
while (scanf("%lld %lld", &m, &x), x||m)
{
if (x == 100 || x == 0 || m == 1)
puts("Not found");
else
{
if ((m-1)*100/(100-x))
printf("%lld\n", (m-1)*100/(100-x));
else
puts("Not found");
}
}
return 0;
}
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
long double m,x;
long double dal;
long long v;
while (cin>>m>>x)
{
if (m==0&&x==0)
break;
if (x==100||m==1||x==0)
{
printf("Not found\n");
continue;
}
dal = 1 - x/100.0;
v = (int)((m-1)/dal-1E-6);
if (v<m)
{
printf("Not found\n");
}
else
{
cout<<v<<endl;
}
}
return 0;
}