A9400 | Mashmokh and Tokens
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
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.
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.
输入格式
The first line of input contains three space-separated integers $n,a,b (1<=n<=10^{5}; 1<=a,b<=10^{9})$ . The second line of input contains $n$ space-separated integers $x_{1},x_{2},...,x_{n} (1<=x_{i}<=10^{9})$ .
输出格式
Output $n$ space-separated integers. The $i$ -th of them is the number of tokens Mashmokh can save on the $i$ -th day.
输入输出样例
输入 #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
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted