UPC个人赛第十二场补题:Tax Included Price

题目描述

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;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值