题目描述
The consumption tax rate in the Republic of ARC is t percent, where t is a positive integer.
There is a shop called Seisu-ya (integer shop) there. It sells each positive integer A for A yen (Japanese currency) excluding tax, that is, ⌊(100+t)A/100⌋ yen including tax. Here, ⌊x⌋ denotes the largest integer not greater than x for a real number x.
Although Seisu-ya sells every positive integer, there are some positive integer values that cannot be the tax-included price of an integer. Among those values, find the N-th smallest value.
Constraints
1≤t≤50
1≤N≤1e9
输入
Input is given from Standard Input in the following format:
t N
输出
Print the answer.
样例输入
【样例1】
10 1
【样例2】
3 5
【样例3】
1 1000000000
样例输出
【样例1】
10
【样例2】
171
【样例3】
100999999999
提示
样例1解释
In this sample, the consumption tax rate is 10 percent.
The integer 9 is sold for ⌊110/100×9⌋=⌊9.9⌋=9 yen including tax.
The integer 10 is sold for ⌊110/100×10⌋=⌊11⌋=11 yen including tax.
From above, we can see that 10 is not the tax-included price of any integer, and this is the minimum such value.
样例2解释
If the consumption tax rate is 3 percent, the smallest values that cannot be the tax-included price of an integer are 34,68,102,137,171,…
思路
推导公式就可以了,拿例二来说,100/3=33.333,拿这个结果乘1.03,然后减一就可以了,第几个就在乘1.03之前乘几,思路就是不断填充t,看看哪些是被跳过了,就输出这个数,代码是非常简单的输入输出
代码
#include<bits/stdc++.h>
using namespace std;
int main()
{
double a,b;
cin>>a>>b;
printf("%.0lf",ceil((100/a)*b*((100+a)/100))-1);
return 0;
}