oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

pancakecounting Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

pancakecounting.html

Problem Description

Rar the Cat loves pancakes! (ahem)
Recently, he has bought many many pancakes, and has arranged them nicely into N stacks, where each stack contains no more than 1000 pancakes. Just when he thought his beautiful arrangement was just about complete, he suddenly realises he has left out an entire box of pancakes unstacked! What a careless cat! He carefully counts the pancakes, and realises that there is only enough pancakes in the box to put another K pancakes on top of each stack. Given the number of pancakes on each stack at first, help Rar the Cat by telling him the number of pancakes on each stack he would have after all N*K pancakes have been added to their various stacks.

Input

The first line of input will consist of one integer, N. The next N lines of input will consist of one integer, where the integer on line i will correspond to the number of pancakes that are present on stack i.
The final line of input will consist of one integer, K.

Output

Your output should contain N lines of one integer each, where the integer on line i will indicate the new number of pancakes on stack i.

Limits

Subtask 1 (40%):
1 <= N <= 1,000
1 <= K <= 5

Subtask 2 (60%):
1 <= N <= 1,000,000
1 <= K <= 5

Sample Input 1

5
1
2
3
4
5
1

Sample Output 1

2
3
4
5
6

Tags

Syntax, Bit Manipulation

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
14061s64MBMinimum
26091s2MBMinimum
3011s64MBMinimum

Judge Compile Command

g++-8 ans.cpp -o pancakecounting -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.