CF415B.Mashmokh and Tokens
普及/提高-
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Bimokh is Mashmokh's boss. For the following n days he decided to pay to his workers in a new way. At the beginning of each day he will give each worker a certain amount of tokens. Then at the end of each day each worker can give some of his tokens back to get a certain amount of money. The worker can save the rest of tokens but he can't use it in any other day to get more money. If a worker gives back w tokens then he'll get
dollars.
Mashmokh likes the tokens however he likes money more. That's why he wants to save as many tokens as possible so that the amount of money he gets is maximal possible each day. He has n numbers _x_1, _x_2, ..., x__n. Number x__i is the number of tokens given to each worker on the i-th day. Help him calculate for each of n days the number of tokens he can save.
比莫赫是马什莫赫的老板。在接下来的 n 天里,他决定以一种新方式向员工支付报酬。每天开始时,他会向每位员工发放一定数量的代币;每天结束时,每位员工可将部分代币退还,以换取一定金额的钱。员工可以保存剩余的代币,但这些代币无法在其他任何一天用于换取更多金钱。若一名员工退还 w 个代币,则他将获得
美元。
马什莫赫喜欢代币,但他更喜欢金钱。因此,他希望在每天获得最大可能金额的前提下,尽可能多地保存代币。他有 n 个数:x1,x2,…,xn,其中 xi 表示第 i 天发放给每位员工的代币数量。请帮他计算:对于这 n 天中的每一天,他最多可以保存多少代币。
输入格式
The first line of input contains three space-separated integers n, a, b (1 ≤ n ≤ 105; 1 ≤ a, b ≤ 109). The second line of input contains n space-separated integers _x_1, _x_2, ..., x__n (1 ≤ x__i ≤ 109).
输入的第一行包含三个用空格分隔的整数 n、a、b(1 ≤ n ≤ 105;1 ≤ a, b ≤ 109)。输入的第二行包含 n 个用空格分隔的整数 x1, x2, ..., xn(1 ≤ xi ≤ 109)。
输出格式
Output n space-separated integers. The i-th of them is the number of tokens Mashmokh can save on the i-th day.
输出 n 个用空格分隔的整数。其中第 i 个整数表示 Mashmokh 在第 i 天能够节省的代币数量。
输入输出样例
输入#1
5 1 4 12 6 11 9 1
输出#1
0 2 3 1 1
输入#2
3 1 2 1 2 3
输出#2
1 0 1
输入#3
1 1 1 1
输出#3
0
输入解题思路,AI测评打分。不知道怎么写?